Browse Source

* add database schema and config sample

master
Alex 'AdUser' Z 7 years ago
parent
commit
93750a6b11
  1. 1
      cmtd.conf
  2. 9
      docs/cmtd.conf.sample
  3. 42
      docs/schema.sqlite3.sql

1
cmtd.conf

@ -1 +0,0 @@
{}

9
docs/cmtd.conf.sample

@ -0,0 +1,9 @@
{
db => ['dbi:SQLite:dbname=data/data.db'],
captcha => {
table => 'captcha',
tries => 5,
limit => 500,
ft_file => '/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf'
},
}

42
docs/schema.sqlite3.sql

@ -0,0 +1,42 @@
BEGIN TRANSACTION;
CREATE TABLE "sites" (
"id" INTEGER PRIMARY KEY NOT NULL,
"site" varchar(4) NOT NULL
);
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" ("hash");
CREATE TABLE "comments" (
"id" INTEGER PRIMARY KEY NOT NULL,
"pid" int(11) NOT NULL,
"seq" int(11) NOT NULL,
"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;
Loading…
Cancel
Save