X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=dbscripts%2Fcreate_pg.sql;h=1e331c3399771976a3dfa9a8e9699962151afa59;hb=3d6d6279b8ad710d4ec72ddec1976894ef8099a4;hp=41cd7cc2511d7da70b72dbe9ffc45646b19b52e8;hpb=e595494aec65b60d26875f4641d4226908bdedb4;p=mir.git diff --git a/dbscripts/create_pg.sql b/dbscripts/create_pg.sql index 41cd7cc2..1e331c33 100755 --- a/dbscripts/create_pg.sql +++ b/dbscripts/create_pg.sql @@ -155,8 +155,8 @@ CREATE TABLE "img_color" ( -- language -CREATE SEQUENCE "language_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ; - +CREATE SEQUENCE "language_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ; + CREATE TABLE "language" ( "id" integer DEFAULT nextval('language_id_seq') NOT NULL, "name" character varying(40) NOT NULL, @@ -220,13 +220,13 @@ CREATE TABLE "content_x_topic" ( -- article type -CREATE SEQUENCE "article_type_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ; - +CREATE SEQUENCE "article_type_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ; + CREATE TABLE "article_type" ( "id" integer DEFAULT nextval('article_type_id_seq') NOT NULL, "name" character varying(40) NOT NULL, CONSTRAINT "article_type_pkey" PRIMARY KEY ("id") -); +); -- -- TOC Entry ID 24 (OID 20183) @@ -261,6 +261,7 @@ CREATE TABLE "comment" ( "address" character varying(80), "phone" character varying(20), "webdb_create" timestamp with time zone NOT NULL, + "webdb_lastchange" timestamp with time zone, "is_published" boolean DEFAULT '1' NOT NULL, "to_language" integer DEFAULT '0' NOT NULL, "to_media" integer NOT NULL, @@ -387,14 +388,14 @@ CREATE TABLE "messages" ( -- comment_status -CREATE SEQUENCE "comment_status_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ; - +CREATE SEQUENCE "comment_status_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ; + CREATE TABLE "comment_status" ( "id" integer DEFAULT nextval('comment_status_id_seq') NOT NULL, "name" character varying(40) NOT NULL, CONSTRAINT "comment_status_pkey" PRIMARY KEY ("id") ); - + -- -- TOC Entry ID 33 (OID 20588) @@ -697,3 +698,10 @@ CREATE INDEX "idx_comment_tomedia_ispublished" on "comment" using btree ( "to_m CREATE UNIQUE INDEX "idx_comment_id" on "comment" using btree ( "id" "int4_ops" ); +CREATE TABLE "comment_x_media" ( + "comment_id" integer, + "media_id" integer +); + +CREATE UNIQUE INDEX idx_comment_media on comment_x_media (comment_id, media_id); +CREATE UNIQUE INDEX idx_media_comment on comment_x_media (media_id, comment_id);