diff --git a/db/schema.sql b/db/schema.sql new file mode 100644 index 0000000..947c1df --- /dev/null +++ b/db/schema.sql @@ -0,0 +1,29 @@ +-- Adminer 4.7.5 SQLite 3 dump + +CREATE TABLE "sites" ( + "id" integer NOT NULL, + "host" text COLLATE 'NOCASE' NOT NULL, + "label" text NULL, + "stats_public" numeric NOT NULL DEFAULT '0', + "stats_key" text NOT NULL +); + +CREATE UNIQUE INDEX "sites_host" ON "sites" ("host"); + + +CREATE TABLE "visits" ( + "site_id" integer NOT NULL, + "path" text NOT NULL, + "ts" numeric NOT NULL, + "unique" numeric NOT NULL DEFAULT '0', + "os" text NOT NULL DEFAULT '', + "device" text NOT NULL DEFAULT '', + "browser" text NOT NULL DEFAULT '', + "ref" text NOT NULL DEFAULT '', + "width" integer NOT NULL DEFAULT '' +); + +CREATE INDEX "visits_site_id_path" ON "visits" ("site_id", "path"); + + +-- \ No newline at end of file