updated according to 20031212.sql file
authorrk <rk>
Fri, 12 Dec 2003 18:30:21 +0000 (18:30 +0000)
committerrk <rk>
Fri, 12 Dec 2003 18:30:21 +0000 (18:30 +0000)
dbscripts/create_pg.sql

index d9ce6ab..4783565 100755 (executable)
@@ -76,14 +76,13 @@ CREATE SEQUENCE "webdb_users_id_seq" start 1 increment 1 maxvalue 2147483647 min
 
 CREATE TABLE "webdb_users" (
        "id" integer DEFAULT nextval('webdb_users_id_seq'::text) NOT NULL,
-       "login" character varying(16) NOT NULL,
+       "login" character varying(16) UNIQUE NOT NULL,
        "password" character varying(255) NOT NULL,
        "is_admin" boolean DEFAULT '0' NOT NULL,
        "comment" text,
        Constraint "webdb_users_pkey" Primary Key ("id")
 );
 
-CREATE  INDEX "idx_webdb_user_log_pas_is_admin" on "webdb_users" using btree ( "login" "varchar_ops", "password" "varchar_ops", "is_admin" "bool_ops" );
 
 --
 -- article type
@@ -115,7 +114,6 @@ CREATE TABLE "topic" (
 );
 
 CREATE        INDEX "idx_topic_title" on "topic"           using btree ( "title" "varchar_ops" );
-CREATE UNIQUE INDEX "idx_topic_id"    on "topic"           using btree ( "id" "int4_ops" );
 
 
 -- 
@@ -159,7 +157,6 @@ CREATE        INDEX "comment_checksum_index" on "comment" using btree ( "checksu
 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" );
-CREATE UNIQUE INDEX "idx_comment_id" on "comment" using btree ( "id" "int4_ops" );
 
 
 
@@ -336,7 +333,6 @@ CREATE        INDEX "idx_content_is_produced" on "content" using btree ( "is_pro
 CREATE        INDEX "idx_content_is_published__to_ar" on "content" using btree ( "is_published" "bool_ops", "to_article_type" "int2_ops" );
 CREATE        INDEX "idx_content_is_published__id" on "content" using btree ( "is_published" "bool_ops", "id" "int4_ops" );
 CREATE        INDEX "idx_content_is_pub__to_art__to_" on "content" using btree ( "is_published" "bool_ops", "to_article_type" "int2_ops", "id" "int4_ops" );
-CREATE UNIQUE INDEX "idx_content_id" on "content" using btree ( "id" "int4_ops" );
 CREATE        INDEX "idx_content_is_published" on "content" using btree ( "is_published" "bool_ops" );
 CREATE        INDEX idx_content_webdb_create on content(webdb_create);
 
@@ -348,8 +344,8 @@ CREATE        INDEX idx_content_webdb_create on content(webdb_create);
       "media_id" integer
     );
 
-    CREATE UNIQUE INDEX "idx_content_media" on "content_x_media" using btree ( "content_id" "int4_ops", "media_id" "int4_ops" );
-    CREATE UNIQUE INDEX "idx_media_content" on "content_x_media" using btree ( "media_id" "int4_ops", "content_id" "int4_ops" );
+    CREATE UNIQUE INDEX "idx_cxm_content" on "content_x_media" using btree ( "content_id" "int4_ops" );
+    CREATE UNIQUE INDEX "idx_cxm_media" on "content_x_media" using btree ( "media_id" "int4_ops" );
 
 --
 -- breaking