You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

47 lines
1.2 KiB

BEGIN TRANSACTION;
CREATE TABLE "sites" (
"id" INTEGER PRIMARY KEY NOT NULL,
"site" varchar(4) NOT NULL,
"captcha" int(1) NOT NULL DEFAULT 1
);
CREATE UNIQUE INDEX "sites_uniq" ON "sites" ("site");
CREATE TABLE "pages" (
"id" INTEGER PRIMARY KEY NOT NULL,
"sid" int(11) NOT NULL,
"hash" varchar(32) NOT NULL,
"path" text NULL DEFAULT '',
FOREIGN KEY ("id") REFERENCES "sites" ("id")
ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE UNIQUE INDEX "pages_uniq" ON "pages" ("sid", "hash");
CREATE TABLE "comments" (
"id" INTEGER PRIMARY KEY NOT NULL,
"pid" int(11) NOT NULL,
"seq" int(11) NOT NULL,
"date" int(11) NOT NULL,
"reply" int(11) NOT NULL DEFAULT 0,
"notify" int(1) NOT NULL DEFAULT 0,
"addr" varchar(32) NOT NULL DEFAULT '',
"name" varchar(255) NOT NULL DEFAULT '',
"email" varchar(255) NOT NULL DEFAULT '',
"text" text NOT NULL,
FOREIGN KEY ("pid") REFERENCES "pages" ("id")
ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE UNIQUE INDEX "page_comments" ON "comments" ("pid", "seq");
CREATE TABLE "captcha" (
"id" INTEGER PRIMARY KEY NOT NULL,
"tries" INTEGER NOT NULL DEFAULT 0,
"shown" INTEGER NOT NULL DEFAULT 0,
"code" varchar(16) NOT NULL,
"data" TEXT NOT NULL
);
COMMIT;