DROP TABLE IF EXISTS site;

-- DROP SEQUENCE IF EXISTS site_site_id_seq;
-- CREATE SEQUENCE site_site_id_seq;

CREATE TABLE site (
  "site_id" smallint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
  "key" varchar(191) NOT NULL,
  "name" varchar(191) NOT NULL,
  "host" varchar(191) NOT NULL,
  "theme" varchar(191) NOT NULL,
  "template" varchar(191) NOT NULL DEFAULT '',
  "settings" text DEFAULT NULL
  -- PRIMARY KEY("site_id")
);

SELECT setval('site_site_id_seq', 1, true); -- last inserted id by sample data