first cut of merge of STABLE-pre1_0 into HEAD. I won't even guarantee that it
[mir.git] / dbscripts / create_pg.sql
index 86bd687..997dfcd 100755 (executable)
@@ -3,7 +3,7 @@
 --
 \connect - postgres
 --
--- TOC Entry ID 2 (OID 28714)
+-- TOC Entry ID 2 (OID 19796)
 --
 -- Name: media_id_seq Type: SEQUENCE Owner: postgres
 --
@@ -11,7 +11,7 @@
 CREATE SEQUENCE "media_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
 
 --
--- TOC Entry ID 3 (OID 28733)
+-- TOC Entry ID 3 (OID 19815)
 --
 -- Name: media_folder_id_seq Type: SEQUENCE Owner: postgres
 --
@@ -19,15 +19,7 @@ CREATE SEQUENCE "media_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue
 CREATE SEQUENCE "media_folder_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
 
 --
--- TOC Entry ID 4 (OID 28752)
---
--- Name: creator_id_seq Type: SEQUENCE Owner: postgres
---
-
-CREATE SEQUENCE "creator_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
-
---
--- TOC Entry ID 5 (OID 28771)
+-- TOC Entry ID 4 (OID 19834)
 --
 -- Name: feature_id_seq Type: SEQUENCE Owner: postgres
 --
@@ -35,7 +27,7 @@ CREATE SEQUENCE "creator_id_seq" start 1 increment 1 maxvalue 2147483647 minvalu
 CREATE SEQUENCE "feature_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
 
 --
--- TOC Entry ID 6 (OID 28790)
+-- TOC Entry ID 5 (OID 19853)
 --
 -- Name: topic_id_seq Type: SEQUENCE Owner: postgres
 --
@@ -43,7 +35,7 @@ CREATE SEQUENCE "feature_id_seq" start 1 increment 1 maxvalue 2147483647 minvalu
 CREATE SEQUENCE "topic_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
 
 --
--- TOC Entry ID 7 (OID 28809)
+-- TOC Entry ID 6 (OID 19872)
 --
 -- Name: webdb_users_id_seq Type: SEQUENCE Owner: postgres
 --
@@ -51,7 +43,7 @@ CREATE SEQUENCE "topic_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue
 CREATE SEQUENCE "webdb_users_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
 
 --
--- TOC Entry ID 8 (OID 28828)
+-- TOC Entry ID 7 (OID 19891)
 --
 -- Name: comment_id_seq Type: SEQUENCE Owner: postgres
 --
@@ -59,7 +51,7 @@ CREATE SEQUENCE "webdb_users_id_seq" start 1 increment 1 maxvalue 2147483647 min
 CREATE SEQUENCE "comment_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
 
 --
--- TOC Entry ID 9 (OID 28847)
+-- TOC Entry ID 8 (OID 19910)
 --
 -- Name: breaking_id_seq Type: SEQUENCE Owner: postgres
 --
@@ -67,7 +59,7 @@ CREATE SEQUENCE "comment_id_seq" start 1 increment 1 maxvalue 2147483647 minvalu
 CREATE SEQUENCE "breaking_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
 
 --
--- TOC Entry ID 10 (OID 28866)
+-- TOC Entry ID 9 (OID 19929)
 --
 -- Name: messages_id_seq Type: SEQUENCE Owner: postgres
 --
@@ -75,7 +67,7 @@ CREATE SEQUENCE "breaking_id_seq" start 1 increment 1 maxvalue 2147483647 minval
 CREATE SEQUENCE "messages_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
 
 --
--- TOC Entry ID 10 (OID 28866)
+-- TOC Entry ID 10 (OID 19948)
 --
 -- Name: media_type_id_seq Type: SEQUENCE Owner: postgres
 --
@@ -83,7 +75,7 @@ CREATE SEQUENCE "messages_id_seq" start 1 increment 1 maxvalue 2147483647 minval
 CREATE SEQUENCE "media_type_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
 
 --
--- TOC Entry ID 12 (OID 28885)
+-- TOC Entry ID 12 (OID 19967)
 --
 -- Name: media_folder Type: TABLE Owner: postgres
 --
@@ -100,13 +92,13 @@ CREATE TABLE "media_folder" (
 );
 
 --
--- TOC Entry ID 13 (OID 28918)
+-- TOC Entry ID 13 (OID 20000)
 --
 -- Name: media_type Type: TABLE Owner: postgres
 --
 
 CREATE TABLE "media_type" (
-       "id" integer DEFAULT nextval('media_type_id_seq'::text) NOT NULL,
+       "id" integer DEFAULT nextval('media_type_id_seq'::text) NOT NULL,
        "name" character varying(80) NOT NULL,
        "mime_type" character varying(40) NOT NULL,
        "classname" character varying(80) NOT NULL,
@@ -115,7 +107,7 @@ CREATE TABLE "media_type" (
 );
 
 --
--- TOC Entry ID 14 (OID 28932)
+-- TOC Entry ID 14 (OID 20016)
 --
 -- Name: img_format Type: TABLE Owner: postgres
 --
@@ -129,7 +121,7 @@ CREATE TABLE "img_format" (
 );
 
 --
--- TOC Entry ID 15 (OID 28946)
+-- TOC Entry ID 15 (OID 20030)
 --
 -- Name: img_layout Type: TABLE Owner: postgres
 --
@@ -140,7 +132,7 @@ CREATE TABLE "img_layout" (
 );
 
 --
--- TOC Entry ID 16 (OID 28957)
+-- TOC Entry ID 16 (OID 20041)
 --
 -- Name: img_type Type: TABLE Owner: postgres
 --
@@ -151,7 +143,7 @@ CREATE TABLE "img_type" (
 );
 
 --
--- TOC Entry ID 17 (OID 28968)
+-- TOC Entry ID 17 (OID 20052)
 --
 -- Name: img_color Type: TABLE Owner: postgres
 --
@@ -162,7 +154,7 @@ CREATE TABLE "img_color" (
 );
 
 --
--- TOC Entry ID 18 (OID 28979)
+-- TOC Entry ID 18 (OID 20063)
 --
 -- Name: language Type: TABLE Owner: postgres
 --
@@ -175,7 +167,7 @@ CREATE TABLE "language" (
 );
 
 --
--- TOC Entry ID 19 (OID 28994)
+-- TOC Entry ID 19 (OID 20078)
 --
 -- Name: rights Type: TABLE Owner: postgres
 --
@@ -188,23 +180,7 @@ CREATE TABLE "rights" (
 );
 
 --
--- TOC Entry ID 20 (OID 29024)
---
--- Name: creator Type: TABLE Owner: postgres
---
-
-CREATE TABLE "creator" (
-       "id" integer DEFAULT nextval('creator_id_seq'::text) NOT NULL,
-       "name" character varying(80) NOT NULL,
-       "main_url" character varying(255),
-       "email" character varying(80),
-       "address" character varying(80),
-       "phone" character varying(20),
-       Constraint "creator_pkey" Primary Key ("id")
-);
-
---
--- TOC Entry ID 21 (OID 29043)
+-- TOC Entry ID 20 (OID 20108)
 --
 -- Name: feature Type: TABLE Owner: postgres
 --
@@ -220,7 +196,7 @@ CREATE TABLE "feature" (
 );
 
 --
--- TOC Entry ID 22 (OID 29078)
+-- TOC Entry ID 21 (OID 20143)
 --
 -- Name: webdb_users Type: TABLE Owner: postgres
 --
@@ -234,7 +210,7 @@ CREATE TABLE "webdb_users" (
 );
 
 --
--- TOC Entry ID 23 (OID 29096)
+-- TOC Entry ID 22 (OID 20161)
 --
 -- Name: content_x_topic Type: TABLE Owner: postgres
 --
@@ -245,7 +221,7 @@ CREATE TABLE "content_x_topic" (
 );
 
 --
--- TOC Entry ID 24 (OID 29107)
+-- TOC Entry ID 23 (OID 20172)
 --
 -- Name: article_type Type: TABLE Owner: postgres
 --
@@ -256,7 +232,7 @@ CREATE TABLE "article_type" (
 );
 
 --
--- TOC Entry ID 25 (OID 29118)
+-- TOC Entry ID 24 (OID 20183)
 --
 -- Name: topic Type: TABLE Owner: postgres
 --
@@ -273,7 +249,7 @@ CREATE TABLE "topic" (
 );
 
 --
--- TOC Entry ID 26 (OID 29154)
+-- TOC Entry ID 25 (OID 20219)
 --
 -- Name: comment Type: TABLE Owner: postgres
 --
@@ -292,11 +268,12 @@ CREATE TABLE "comment" (
        "to_language" integer DEFAULT '0' NOT NULL,
        "to_media" integer NOT NULL,
        "to_comment_status" smallint,
+       "checksum" integer,
        Constraint "comment_pkey" Primary Key ("id")
 );
 
 --
--- TOC Entry ID 27 (OID 29196)
+-- TOC Entry ID 26 (OID 20266)
 --
 -- Name: media Type: TABLE Owner: postgres
 --
@@ -307,7 +284,6 @@ CREATE TABLE "media" (
        "subtitle" character varying(30),
        "edittitle" character varying(30),
        "date" character(8) NOT NULL,
-       "place" character varying(80),
        "creator" character varying(80),
        "creator_main_url" character varying(255),
        "creator_email" character varying(80),
@@ -321,10 +297,10 @@ CREATE TABLE "media" (
        "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_creator" integer DEFAULT '0' NOT NULL,
        "to_publisher" integer NOT NULL,
        "to_language" integer DEFAULT '0',
        "to_rights" integer DEFAULT '0',
@@ -334,7 +310,20 @@ CREATE TABLE "media" (
 );
 
 --
--- TOC Entry ID 28 (OID 29257)
+-- TOC Entry ID 27 (OID 20326)
+--
+-- Name: uploaded_media Type: TABLE Owner: postgres
+--
+
+CREATE TABLE "uploaded_media" (
+       "icon_is_produced" boolean DEFAULT '0' NOT NULL,
+       "icon_path" character varying(255),
+       "size" integer
+)
+INHERITS ("media");
+
+--
+-- TOC Entry ID 28 (OID 20392)
 --
 -- Name: images Type: TABLE Owner: postgres
 --
@@ -342,8 +331,6 @@ CREATE TABLE "media" (
 CREATE TABLE "images" (
        "image_data" oid,
        "icon_data" oid,
-       "icon_path" character varying(255),
-       "icon_is_produced" boolean DEFAULT '0' NOT NULL,
        "year" character varying(40),
        "img_width" smallint,
        "img_height" smallint,
@@ -354,10 +341,10 @@ CREATE TABLE "images" (
        "icon_width" smallint,
        "icon_height" smallint
 )
-INHERITS ("media");
+INHERITS ("uploaded_media");
 
 --
--- TOC Entry ID 29 (OID 29338)
+-- TOC Entry ID 29 (OID 20474)
 --
 -- Name: content Type: TABLE Owner: postgres
 --
@@ -365,21 +352,16 @@ INHERITS ("media");
 CREATE TABLE "content" (
        "content_data" text,
        "link_url" character varying(255),
-       "date_from" character varying(8),
-       "date_to" character varying(8),
-       "date_name" character varying(255),
        "is_html" boolean DEFAULT '0' NOT NULL,
-       "is_produced" boolean DEFAULT '0' NOT NULL,
        "is_stored" boolean DEFAULT '0' NOT NULL,
-       "is_mail_sent" boolean DEFAULT '1' NOT NULL,
-       "is_digest_sent" boolean DEFAULT '1' NOT NULL,
        "to_article_type" smallint DEFAULT '0' NOT NULL,
-       "to_content" integer
+       "to_content" integer,
+       "checksum" integer
 )
 INHERITS ("media");
 
 --
--- TOC Entry ID 30 (OID 29418)
+-- TOC Entry ID 30 (OID 20549)
 --
 -- Name: breaking Type: TABLE Owner: postgres
 --
@@ -391,7 +373,7 @@ CREATE TABLE "breaking" (
 );
 
 --
--- TOC Entry ID 31 (OID 29431)
+-- TOC Entry ID 31 (OID 20562)
 --
 -- Name: messages Type: TABLE Owner: postgres
 --
@@ -405,17 +387,7 @@ CREATE TABLE "messages" (
 );
 
 --
--- TOC Entry ID 32 (OID 29446)
---
--- Name: uploaded_media Type: TABLE Owner: postgres
---
-
-CREATE TABLE "uploaded_media" (
-) INHERITS ("media");
-
---
--- TOC Entry ID 33 (OID 30026)
+-- TOC Entry ID 32 (OID 20577)
 --
 -- Name: comment_status Type: TABLE Owner: postgres
 --
@@ -426,7 +398,7 @@ CREATE TABLE "comment_status" (
 );
 
 --
--- TOC Entry ID 34 (OID 30064)
+-- TOC Entry ID 33 (OID 20588)
 --
 -- Name: content_x_media Type: TABLE Owner: postgres
 --
@@ -437,7 +409,7 @@ CREATE TABLE "content_x_media" (
 );
 
 --
--- TOC Entry ID 11 (OID 32812)
+-- TOC Entry ID 11 (OID 20599)
 --
 -- Name: links_imcs_id_seq Type: SEQUENCE Owner: postgres
 --
@@ -445,7 +417,7 @@ CREATE TABLE "content_x_media" (
 CREATE SEQUENCE "links_imcs_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
 
 --
--- TOC Entry ID 35 (OID 32831)
+-- TOC Entry ID 34 (OID 20618)
 --
 -- Name: links_imcs Type: TABLE Owner: postgres
 --
@@ -461,7 +433,41 @@ CREATE TABLE "links_imcs" (
 );
 
 --
--- TOC Entry ID 40 (OID 29078)
+-- TOC Entry ID 35 (OID 37215)
+--
+-- Name: audio Type: TABLE Owner: postgres
+--
+
+CREATE TABLE "audio" (
+       "audio_data" oid,
+       "kbits" smallint
+)
+INHERITS ("uploaded_media");
+
+--
+-- TOC Entry ID 36 (OID 37284)
+--
+-- Name: video Type: TABLE Owner: postgres
+--
+
+CREATE TABLE "video" (
+       "video_data" oid
+)
+INHERITS ("uploaded_media");
+
+--
+-- TOC Entry ID 37 (OID 45396)
+--
+-- Name: other_media Type: TABLE Owner: postgres
+--
+
+CREATE TABLE "other_media" (
+       
+)
+INHERITS ("uploaded_media");
+
+--
+-- TOC Entry ID 40 (OID 20143)
 --
 -- Name: "idx_webdb_user_log_pas_is_admin" Type: INDEX Owner: postgres
 --
@@ -469,7 +475,7 @@ CREATE TABLE "links_imcs" (
 CREATE  INDEX "idx_webdb_user_log_pas_is_admin" on "webdb_users" using btree ( "login" "varchar_ops", "password" "varchar_ops", "is_admin" "bool_ops" );
 
 --
--- TOC Entry ID 44 (OID 29078)
+-- TOC Entry ID 41 (OID 20143)
 --
 -- Name: "idx_webdb_user_log_pas" Type: INDEX Owner: postgres
 --
@@ -477,7 +483,7 @@ CREATE  INDEX "idx_webdb_user_log_pas_is_admin" on "webdb_users" using btree ( "
 CREATE  INDEX "idx_webdb_user_log_pas" on "webdb_users" using btree ( "login" "varchar_ops", "password" "varchar_ops" );
 
 --
--- TOC Entry ID 43 (OID 29096)
+-- TOC Entry ID 42 (OID 20161)
 --
 -- Name: "idx_content" Type: INDEX Owner: postgres
 --
@@ -485,7 +491,7 @@ CREATE  INDEX "idx_webdb_user_log_pas" on "webdb_users" using btree ( "login" "v
 CREATE UNIQUE INDEX "idx_content" on "content_x_topic" using btree ( "content_id" "int4_ops", "topic_id" "int4_ops" );
 
 --
--- TOC Entry ID 45 (OID 29096)
+-- TOC Entry ID 43 (OID 20161)
 --
 -- Name: "idx_topic" Type: INDEX Owner: postgres
 --
@@ -493,7 +499,7 @@ CREATE UNIQUE INDEX "idx_content" on "content_x_topic" using btree ( "content_id
 CREATE UNIQUE INDEX "idx_topic" on "content_x_topic" using btree ( "topic_id" "int4_ops", "content_id" "int4_ops" );
 
 --
--- TOC Entry ID 46 (OID 29118)
+-- TOC Entry ID 44 (OID 20183)
 --
 -- Name: "idx_topic_title" Type: INDEX Owner: postgres
 --
@@ -501,7 +507,7 @@ CREATE UNIQUE INDEX "idx_topic" on "content_x_topic" using btree ( "topic_id" "i
 CREATE  INDEX "idx_topic_title" on "topic" using btree ( "title" "varchar_ops" );
 
 --
--- TOC Entry ID 51 (OID 29118)
+-- TOC Entry ID 45 (OID 20183)
 --
 -- Name: "idx_topic_id" Type: INDEX Owner: postgres
 --
@@ -509,7 +515,15 @@ 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" );
 
 --
--- TOC Entry ID 36 (OID 29154)
+-- TOC Entry ID 38 (OID 20219)
+--
+-- Name: "comment_checksum_index" Type: INDEX Owner: postgres
+--
+
+CREATE  INDEX "comment_checksum_index" on "comment" using btree ( "checksum" "int4_ops" );
+
+--
+-- TOC Entry ID 46 (OID 20219)
 --
 -- Name: "idx_comment_to_media" Type: INDEX Owner: postgres
 --
@@ -517,7 +531,25 @@ CREATE UNIQUE INDEX "idx_topic_id" on "topic" using btree ( "id" "int4_ops" );
 CREATE  INDEX "idx_comment_to_media" on "comment" using btree ( "to_media" "int4_ops" );
 
 --
--- TOC Entry ID 47 (OID 29257)
+
+--
+-- TOC Entry ID 59 (OID 20326)
+--
+-- Name: "idx_uploaded_media_id" Type: INDEX Owner: postgres
+--
+
+CREATE UNIQUE INDEX "idx_uploaded_media_id" on "uploaded_media" using btree ( "id" "int4_ops" );
+
+--
+-- TOC Entry ID 60 (OID 20326)
+--
+-- Name: "idx_uploaded_media_is_published" Type: INDEX Owner: postgres
+--
+
+CREATE UNIQUE INDEX "idx_uploaded_media_is_published" on "uploaded_media" using btree ( "id" "int4_ops", "is_published" "bool_ops" );
+
+--
+-- TOC Entry ID 47 (OID 20392)
 --
 -- Name: "idx_images_is_published__icon_i" Type: INDEX Owner: postgres
 --
@@ -525,7 +557,7 @@ CREATE  INDEX "idx_comment_to_media" on "comment" using btree ( "to_media" "int4
 CREATE  INDEX "idx_images_is_published__icon_i" on "images" using btree ( "is_published" "bool_ops", "icon_is_produced" "bool_ops" );
 
 --
--- TOC Entry ID 49 (OID 29257)
+-- TOC Entry ID 48 (OID 20392)
 --
 -- Name: "idx_images_id" Type: INDEX Owner: postgres
 --
@@ -533,7 +565,15 @@ CREATE  INDEX "idx_images_is_published__icon_i" on "images" using btree ( "is_pu
 CREATE UNIQUE INDEX "idx_images_id" on "images" using btree ( "id" "int4_ops" );
 
 --
--- TOC Entry ID 37 (OID 29338)
+-- TOC Entry ID 39 (OID 20474)
+--
+-- Name: "content_checksum_index" Type: INDEX Owner: postgres
+--
+
+CREATE  INDEX "content_checksum_index" on "content" using btree ( "checksum" "int4_ops" );
+
+--
+-- TOC Entry ID 49 (OID 20474)
 --
 -- Name: "idx_content_to_article_type" Type: INDEX Owner: postgres
 --
@@ -541,7 +581,7 @@ CREATE UNIQUE INDEX "idx_images_id" on "images" using btree ( "id" "int4_ops" );
 CREATE  INDEX "idx_content_to_article_type" on "content" using btree ( "to_article_type" "int2_ops" );
 
 --
--- TOC Entry ID 38 (OID 29338)
+-- TOC Entry ID 50 (OID 20474)
 --
 -- Name: "idx_content_is_produced" Type: INDEX Owner: postgres
 --
@@ -549,7 +589,7 @@ CREATE  INDEX "idx_content_to_article_type" on "content" using btree ( "to_artic
 CREATE  INDEX "idx_content_is_produced" on "content" using btree ( "is_produced" "bool_ops" );
 
 --
--- TOC Entry ID 39 (OID 29338)
+-- TOC Entry ID 51 (OID 20474)
 --
 -- Name: "idx_content_is_published__to_ar" Type: INDEX Owner: postgres
 --
@@ -557,7 +597,7 @@ CREATE  INDEX "idx_content_is_produced" on "content" using btree ( "is_produced"
 CREATE  INDEX "idx_content_is_published__to_ar" on "content" using btree ( "is_published" "bool_ops", "to_article_type" "int2_ops" );
 
 --
--- TOC Entry ID 41 (OID 29338)
+-- TOC Entry ID 52 (OID 20474)
 --
 -- Name: "idx_content_is_stored" Type: INDEX Owner: postgres
 --
@@ -565,7 +605,7 @@ CREATE  INDEX "idx_content_is_published__to_ar" on "content" using btree ( "is_p
 CREATE  INDEX "idx_content_is_stored" on "content" using btree ( "is_stored" "bool_ops" );
 
 --
--- TOC Entry ID 42 (OID 29338)
+-- TOC Entry ID 53 (OID 20474)
 --
 -- Name: "idx_content_is_published__id" Type: INDEX Owner: postgres
 --
@@ -573,7 +613,7 @@ CREATE  INDEX "idx_content_is_stored" on "content" using btree ( "is_stored" "bo
 CREATE  INDEX "idx_content_is_published__id" on "content" using btree ( "is_published" "bool_ops", "id" "int4_ops" );
 
 --
--- TOC Entry ID 48 (OID 29338)
+-- TOC Entry ID 54 (OID 20474)
 --
 -- Name: "idx_content_is_pub__to_art__to_" Type: INDEX Owner: postgres
 --
@@ -581,7 +621,7 @@ CREATE  INDEX "idx_content_is_published__id" on "content" using btree ( "is_publ
 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" );
 
 --
--- TOC Entry ID 50 (OID 29338)
+-- TOC Entry ID 55 (OID 20474)
 --
 -- Name: "idx_content_id" Type: INDEX Owner: postgres
 --
@@ -589,7 +629,7 @@ CREATE  INDEX "idx_content_is_pub__to_art__to_" on "content" using btree ( "is_p
 CREATE UNIQUE INDEX "idx_content_id" on "content" using btree ( "id" "int4_ops" );
 
 --
--- TOC Entry ID 52 (OID 30064)
+-- TOC Entry ID 56 (OID 20588)
 --
 -- Name: "idx_content_media" Type: INDEX Owner: postgres
 --
@@ -597,10 +637,60 @@ CREATE UNIQUE INDEX "idx_content_id" on "content" using btree ( "id" "int4_ops"
 CREATE UNIQUE INDEX "idx_content_media" on "content_x_media" using btree ( "content_id" "int4_ops", "media_id" "int4_ops" );
 
 --
--- TOC Entry ID 53 (OID 30064)
+-- TOC Entry ID 57 (OID 20588)
 --
 -- Name: "idx_media_content" Type: INDEX Owner: postgres
 --
 
 CREATE UNIQUE INDEX "idx_media_content" on "content_x_media" using btree ( "media_id" "int4_ops", "content_id" "int4_ops" );
 
+--
+-- TOC Entry ID 62 (OID 37215)
+--
+-- Name: "idx_audio_is_published_produced" Type: INDEX Owner: postgres
+--
+
+CREATE  INDEX "idx_audio_is_published_produced" on "audio" using btree ( "is_published" "bool_ops", "is_produced" "bool_ops" );
+
+--
+-- TOC Entry ID 64 (OID 37215)
+--
+-- Name: "idx_audio_id" Type: INDEX Owner: postgres
+--
+
+CREATE UNIQUE INDEX "idx_audio_id" on "audio" using btree ( "id" "int4_ops" );
+
+--
+-- TOC Entry ID 65 (OID 37215)
+--
+-- Name: "idx_video_id" Type: INDEX Owner: postgres
+--
+
+CREATE UNIQUE INDEX "idx_video_id" on "audio" using btree ( "id" "int4_ops" );
+
+--
+-- TOC Entry ID 63 (OID 37284)
+--
+-- Name: "idx_video_is_published_produced" Type: INDEX Owner: postgres
+--
+
+CREATE  INDEX "idx_video_is_published_produced" on "video" using btree ( "is_published" "bool_ops", "is_produced" "bool_ops" );
+
+
+--
+-- TOC Entry ID 37 (OID 520246)
+--
+-- Name: "idx_content_is_published" Type: INDEX Owner: postgres
+--
+
+CREATE  INDEX "idx_content_is_published" on "content" using btree ( "is_published" "bool_ops" );
+
+--
+-- TOC Entry ID 47 (OID 465036)
+--
+-- Name: "idx_comment_tomedia_ispublished" Type: INDEX Owner: postgres
+--
+
+CREATE  INDEX "idx_comment_tomedia_ispublished" on "comment" using btree ( "to_media" "int4_ops", "is_published" "bool_ops" );
+
+