CREATE TABLE "page" ( "id" int, "type" varchar(255), "status" varchar(255), "template" varchar(255), "callback" varchar(255), "parent_id" int FOREIGN KEY("parent_id") REFERENCES "page" ("id"), "sort_order" varchar(255), "date_created" datetime, "date_modified" datetime, "site_id" int FOREIGN KEY("site_id") REFERENCES "site" ("id") ); CREATE TABLE "language" ( "id" int, "name" varchar(255), "iso_code" varchar(255), "sort_order" varchar(255), "group" varchar(255) ); CREATE TABLE "page_texts" ( "id" int, "page_id" int FOREIGN KEY("page_id") REFERENCES "page" ("id"), "language_id" int FOREIGN KEY("language_id") REFERENCES "language" ("id"), "slug" varchar(255), "title" varchar(255), "content" longtext ); CREATE TABLE "term" ( "id" int, "taxonomy" varchar(255), "sort_order" varchar(255), "date_created" datetime, "date_modified" datetime FOREIGN KEY("date_modified") REFERENCES "date" ("modified") ); CREATE TABLE "term_texts" ( "id" int, "term_id" int FOREIGN KEY("term_id") REFERENCES "term" ("id"), "language_id" int FOREIGN KEY("language_id") REFERENCES "language" ("id"), "slug" varchar(255), "title" varchar(255), "content" longtext ); CREATE TABLE "page_terms" ( "id" int, "page_id" int FOREIGN KEY("page_id") REFERENCES "page" ("id"), "term_id" int FOREIGN KEY("term_id") REFERENCES "term" ("id"), "sort_order" varchar(255) FOREIGN KEY("sort_order") REFERENCES "sort" ("order") ); CREATE TABLE "attachment" ( "id" int, "path" varchar(255), "page_id" int FOREIGN KEY("page_id") REFERENCES "page" ("id"), "sort_order" varchar(255), "date_created" datetime, "date_modified" datetime FOREIGN KEY("date_modified") REFERENCES "date" ("modified") ); CREATE TABLE "attachment_texts" ( "id" int, "attachment_id" int FOREIGN KEY("attachment_id") REFERENCES "attachment" ("id"), "language_id" int FOREIGN KEY("language_id") REFERENCES "language" ("id") ); CREATE TABLE "term_attachments" ( "id" int, "term_id" int FOREIGN KEY("term_id") REFERENCES "term" ("id"), "attachment_id" int FOREIGN KEY("attachment_id") REFERENCES "attachment" ("id"), "sort_order" varchar(255) FOREIGN KEY("sort_order") REFERENCES "sort" ("order") ); CREATE TABLE "page_attachments" ( "id" int, "page_id" int FOREIGN KEY("page_id") REFERENCES "page" ("id"), "attachment_id" int FOREIGN KEY("attachment_id") REFERENCES "attachment" ("id"), "sort_order" varchar(255) FOREIGN KEY("sort_order") REFERENCES "sort" ("order") ); CREATE TABLE "comment" ( "id" int, "author_name" varchar(255), "author_email" varchar(255), "author_url" varchar(255), "author_ip" varchar(255), "content" varchar(255), "status" varchar(255), "page_id" int FOREIGN KEY("page_id") REFERENCES "page" ("id"), "language_id" int FOREIGN KEY("language_id") REFERENCES "language" ("id"), "date_created" datetime ); CREATE TABLE "site" ( "id" int, "name" varchar(255), "domain" varchar(255), "basepath" varchar(255), "is_active" bool, "is_maintenance" bool );