CREATE TABLE "page" ( "id" int, "type" varchar(255), "status" varchar(255), "template" varchar(255), "callback" varchar(255), "parent_id" int CONSTRAINT page_id REFERENCES page(id), "sort_order" varchar(255), "date_created" datetime, "date_modified" datetime, "site_id" int CONSTRAINT 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 CONSTRAINT page_id REFERENCES page(id), "language_id" int CONSTRAINT 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 CONSTRAINT date_modified REFERENCES date(modified) ); CREATE TABLE "term_texts" ( "id" int, "term_id" int CONSTRAINT term_id REFERENCES term(id), "language_id" int CONSTRAINT language_id REFERENCES language(id), "slug" varchar(255), "title" varchar(255), "content" longtext ); CREATE TABLE "page_terms" ( "id" int, "page_id" int CONSTRAINT page_id REFERENCES page(id), "term_id" int CONSTRAINT term_id REFERENCES term(id), "sort_order" varchar(255) CONSTRAINT sort_order REFERENCES sort(order) ); CREATE TABLE "attachment" ( "id" int, "path" varchar(255), "page_id" int CONSTRAINT page_id REFERENCES page(id), "sort_order" varchar(255), "date_created" datetime, "date_modified" datetime CONSTRAINT date_modified REFERENCES date(modified) ); CREATE TABLE "attachment_texts" ( "id" int, "attachment_id" int CONSTRAINT attachment_id REFERENCES attachment(id), "language_id" int CONSTRAINT language_id REFERENCES language(id) ); CREATE TABLE "term_attachments" ( "id" int, "term_id" int CONSTRAINT term_id REFERENCES term(id), "attachment_id" int CONSTRAINT attachment_id REFERENCES attachment(id), "sort_order" varchar(255) CONSTRAINT sort_order REFERENCES sort(order) ); CREATE TABLE "page_attachments" ( "id" int, "page_id" int CONSTRAINT page_id REFERENCES page(id), "attachment_id" int CONSTRAINT attachment_id REFERENCES attachment(id), "sort_order" varchar(255) CONSTRAINT 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 CONSTRAINT page_id REFERENCES page(id), "language_id" int CONSTRAINT 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 );