Added features:
[mir.git] / dbscripts / create_pg.sql
index 4783565..a355655 100755 (executable)
@@ -80,7 +80,12 @@ CREATE TABLE "webdb_users" (
        "password" character varying(255) NOT NULL,
        "is_admin" boolean DEFAULT '0' NOT NULL,
        "comment" text,
-       Constraint "webdb_users_pkey" Primary Key ("id")
+       "is_disabled" boolean DEFAULT '0' NOT NULL,
+       "email" character varying(255) DEFAULT '' NOT NULL,
+       "profile" text,
+       "webdb_create"  timestamp with time zone NOT NULL,
+       "lastlogin"  timestamp with time zone,
+       CONSTRAINT "webdb_users_pkey" Primary Key ("id")
 );
 
 
@@ -148,12 +153,11 @@ CREATE TABLE "comment" (
   "to_language" integer DEFAULT '0' NOT NULL,
   "to_media" integer NOT NULL,
   "to_comment_status" smallint,
-  "checksum" integer,
+       "comment" text,
   "is_html" boolean DEFAULT '0' NOT NULL,
   Constraint "comment_pkey" Primary Key ("id")
 );
 
-CREATE        INDEX "comment_checksum_index" on "comment" using btree ( "checksum" "int4_ops" );
 CREATE        INDEX "idx_comment_to_media" on "comment" using btree ( "to_media" "int4_ops" );
 CREATE        INDEX idx_comment_webdb_create on comment(webdb_create);
 CREATE        INDEX "idx_comment_tomedia_ispublished" on "comment" using btree ( "to_media" "int4_ops", "is_published" "bool_ops" );
@@ -174,7 +178,12 @@ CREATE        INDEX "idx_comment_tomedia_ispublished" on "comment" using btree (
 --
 
 CREATE SEQUENCE "media_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-CREATE TABLE "media" (
+
+--
+-- uploaded_media
+--
+
+CREATE TABLE "uploaded_media" (
        "id" integer DEFAULT nextval('media_id_seq'::text) NOT NULL,
        "title" character varying(255),
        "subtitle" character varying(255),
@@ -188,12 +197,10 @@ CREATE TABLE "media" (
        "description" text,
        "comment" text,
        "source" character varying(255),
-       "publish_date" timestamp with time zone,
        "publish_server" character varying(255),
        "publish_path" character varying(255),
        "is_published" boolean DEFAULT '0' NOT NULL,
        "is_produced" boolean DEFAULT '0' NOT NULL,
-       "to_feature" integer DEFAULT '0' NOT NULL,
        "to_media_folder" integer DEFAULT '0' NOT NULL,
        "to_media_type" smallint DEFAULT '0' NOT NULL,
        "to_publisher" integer NOT NULL,
@@ -201,19 +208,11 @@ CREATE TABLE "media" (
        "to_rights" integer DEFAULT '0',
        "webdb_create" timestamp with time zone NOT NULL,
        "webdb_lastchange" timestamp with time zone,
-       "to_media" integer
-);
-
---
--- uploaded_media
---
-
-CREATE TABLE "uploaded_media" (
        "icon_is_produced" boolean DEFAULT '0' NOT NULL,
        "icon_path" character varying(255),
-       "size" integer
-)
-INHERITS ("media");
+       "size" integer,
+       Constraint "uploaded_media_pkey" Primary Key ("id")
+);
 
 CREATE UNIQUE INDEX "idx_uploaded_media_id" on "uploaded_media" using btree ( "id" "int4_ops" );
 CREATE UNIQUE INDEX "idx_uploaded_media_is_published" on "uploaded_media" using btree ( "id" "int4_ops", "is_published" "bool_ops" );
@@ -237,7 +236,7 @@ CREATE TABLE "images" (
 )
 INHERITS ("uploaded_media");
 
-CREATE        INDEX "idx_images_is_published__icon_i" on "images" using btree ( "is_published" "bool_ops", "icon_is_produced" "bool_ops" );
+CREATE        INDEX "idx_images_is_published" on "images" using btree ( "is_published" "bool_ops", "icon_is_produced" "bool_ops" );
 CREATE UNIQUE INDEX "idx_images_id" on "images" using btree ( "id" "int4_ops" );
 
         --
@@ -319,15 +318,36 @@ CREATE UNIQUE INDEX "idx_othermedia_id" on "other_media" using btree ( "id" "int
 --
 
 CREATE TABLE "content" (
+       "id" integer DEFAULT nextval('media_id_seq'::text) NOT NULL,
+       "title" character varying(255),
+       "subtitle" character varying(255),
+       "edittitle" character varying(255),
+       "date" character(8) NOT NULL,
+       "creator" character varying(80),
+       "creator_main_url" character varying(255),
+       "creator_email" character varying(80),
+       "creator_address" character varying(80),
+       "creator_phone" character varying(80),
+       "description" text,
+       "comment" text,
+       "source" character varying(255),
+       "is_published" boolean DEFAULT '0' NOT NULL,
+       "is_produced" boolean DEFAULT '0' NOT NULL,
+       "to_publisher" integer NOT NULL,
+       "to_language" integer DEFAULT '0',
+       "to_rights" integer DEFAULT '0',
+       "webdb_create" timestamp with time zone NOT NULL,
+       "webdb_lastchange" timestamp with time zone,
        "content_data" text,
        "is_html" boolean DEFAULT '0' NOT NULL,
        "to_article_type" smallint DEFAULT '0' NOT NULL,
        "to_content" integer,
-       "checksum" integer
-)
-INHERITS ("media");
+       "keywords" text,
+       "to_locking_user" integer,
+  Constraint "content_pkey" Primary Key ("id")
+);
+
 
-CREATE        INDEX "content_checksum_index" on "content" using btree ( "checksum" "int4_ops" );
 CREATE        INDEX "idx_content_to_article_type" on "content" using btree ( "to_article_type" "int2_ops" );
 CREATE        INDEX "idx_content_is_produced" on "content" using btree ( "is_produced" "bool_ops" );
 CREATE        INDEX "idx_content_is_published__to_ar" on "content" using btree ( "is_published" "bool_ops", "to_article_type" "int2_ops" );