5 CREATE SEQUENCE "media_folder_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
7 CREATE TABLE "media_folder" (
8 "id" integer DEFAULT nextval('media_folder_id_seq'::text) NOT NULL,
9 "name" character varying(255) NOT NULL,
10 "date" character(8) NOT NULL,
11 "place" character varying(80),
14 "webdb_create" timestamp with time zone NOT NULL,
15 "webdb_lastchange" timestamp with time zone
22 CREATE SEQUENCE "media_type_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
24 CREATE TABLE "media_type" (
25 "id" integer DEFAULT nextval('media_type_id_seq'::text) NOT NULL,
26 "name" character varying(80) NOT NULL,
27 "mime_type" character varying(40) NOT NULL,
28 "classname" character varying(80) NOT NULL,
29 "tablename" character varying(80) NOT NULL,
30 "dcname" character varying(20)
37 CREATE SEQUENCE "language_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
39 CREATE TABLE "language" (
40 "id" integer DEFAULT nextval('language_id_seq') NOT NULL,
41 "name" character varying(40) NOT NULL,
42 "code" character varying(2) NOT NULL,
43 Constraint "language_pkey" Primary Key ("id")
50 CREATE SEQUENCE "comment_status_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
52 CREATE TABLE "comment_status" (
53 "id" integer DEFAULT nextval('comment_status_id_seq') NOT NULL,
54 "name" character varying(40) NOT NULL,
55 CONSTRAINT "comment_status_pkey" PRIMARY KEY ("id")
64 CREATE TABLE "rights" (
65 "id" integer NOT NULL,
66 "name" character varying(80) NOT NULL,
68 Constraint "rights_pkey" Primary Key ("id")
75 CREATE SEQUENCE "webdb_users_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
77 CREATE TABLE "webdb_users" (
78 "id" integer DEFAULT nextval('webdb_users_id_seq'::text) NOT NULL,
79 "login" character varying(16) NOT NULL,
80 "password" character varying(255) NOT NULL,
81 "is_admin" boolean DEFAULT '0' NOT NULL,
83 Constraint "webdb_users_pkey" Primary Key ("id")
86 CREATE INDEX "idx_webdb_user_log_pas_is_admin" on "webdb_users" using btree ( "login" "varchar_ops", "password" "varchar_ops", "is_admin" "bool_ops" );
92 CREATE SEQUENCE "article_type_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
94 CREATE TABLE "article_type" (
95 "id" integer DEFAULT nextval('article_type_id_seq') NOT NULL,
96 "name" character varying(40) NOT NULL,
97 CONSTRAINT "article_type_pkey" PRIMARY KEY ("id")
104 CREATE SEQUENCE "topic_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
106 CREATE TABLE "topic" (
107 "id" integer DEFAULT nextval('topic_id_seq'::text) NOT NULL,
109 "title" character varying(80) NOT NULL,
111 "filename" character varying(20) NOT NULL,
112 "main_url" character varying(255),
113 "archiv_url" character varying(255),
114 Constraint "topic_pkey" Primary Key ("id")
117 CREATE INDEX "idx_topic_title" on "topic" using btree ( "title" "varchar_ops" );
118 CREATE UNIQUE INDEX "idx_topic_id" on "topic" using btree ( "id" "int4_ops" );
125 CREATE TABLE "content_x_topic" (
126 "content_id" integer NOT NULL,
127 "topic_id" integer NOT NULL
130 CREATE UNIQUE INDEX "idx_content" on "content_x_topic" using btree ( "content_id" "int4_ops", "topic_id" "int4_ops" );
131 CREATE UNIQUE INDEX "idx_topic" on "content_x_topic" using btree ( "topic_id" "int4_ops", "content_id" "int4_ops" );
137 CREATE SEQUENCE "comment_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
138 CREATE TABLE "comment" (
139 "id" integer DEFAULT nextval('comment_id_seq'::text) NOT NULL,
140 "title" character varying(80) NOT NULL,
141 "creator" character varying(80) NOT NULL,
142 "description" text NOT NULL,
143 "main_url" character varying(255),
144 "email" character varying(80),
145 "address" character varying(80),
146 "phone" character varying(20),
147 "webdb_create" timestamp with time zone NOT NULL,
148 "webdb_lastchange" timestamp with time zone,
149 "is_published" boolean DEFAULT '1' NOT NULL,
150 "to_language" integer DEFAULT '0' NOT NULL,
151 "to_media" integer NOT NULL,
152 "to_comment_status" smallint,
154 "is_html" boolean DEFAULT '0' NOT NULL,
155 Constraint "comment_pkey" Primary Key ("id")
158 CREATE INDEX "comment_checksum_index" on "comment" using btree ( "checksum" "int4_ops" );
159 CREATE INDEX "idx_comment_to_media" on "comment" using btree ( "to_media" "int4_ops" );
160 CREATE INDEX idx_comment_webdb_create on comment(webdb_create);
161 CREATE INDEX "idx_comment_tomedia_ispublished" on "comment" using btree ( "to_media" "int4_ops", "is_published" "bool_ops" );
162 CREATE UNIQUE INDEX "idx_comment_id" on "comment" using btree ( "id" "int4_ops" );
166 CREATE TABLE "comment_x_media" (
167 "comment_id" integer,
171 CREATE UNIQUE INDEX idx_comment_media on comment_x_media (comment_id, media_id);
172 CREATE UNIQUE INDEX idx_media_comment on comment_x_media (media_id, comment_id);
179 CREATE SEQUENCE "media_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
180 CREATE TABLE "media" (
181 "id" integer DEFAULT nextval('media_id_seq'::text) NOT NULL,
182 "title" character varying(255),
183 "subtitle" character varying(255),
184 "edittitle" character varying(255),
185 "date" character(8) NOT NULL,
186 "creator" character varying(80),
187 "creator_main_url" character varying(255),
188 "creator_email" character varying(80),
189 "creator_address" character varying(80),
190 "creator_phone" character varying(20),
193 "source" character varying(255),
194 "publish_date" timestamp with time zone,
195 "publish_server" character varying(255),
196 "publish_path" character varying(255),
197 "is_published" boolean DEFAULT '0' NOT NULL,
198 "is_produced" boolean DEFAULT '0' NOT NULL,
199 "to_feature" integer DEFAULT '0' NOT NULL,
200 "to_media_folder" integer DEFAULT '0' NOT NULL,
201 "to_media_type" smallint DEFAULT '0' NOT NULL,
202 "to_publisher" integer NOT NULL,
203 "to_language" integer DEFAULT '0',
204 "to_rights" integer DEFAULT '0',
205 "webdb_create" timestamp with time zone NOT NULL,
206 "webdb_lastchange" timestamp with time zone,
214 CREATE TABLE "uploaded_media" (
215 "icon_is_produced" boolean DEFAULT '0' NOT NULL,
216 "icon_path" character varying(255),
221 CREATE UNIQUE INDEX "idx_uploaded_media_id" on "uploaded_media" using btree ( "id" "int4_ops" );
222 CREATE UNIQUE INDEX "idx_uploaded_media_is_published" on "uploaded_media" using btree ( "id" "int4_ops", "is_published" "bool_ops" );
228 CREATE TABLE "images" (
231 "year" character varying(40),
232 "img_width" smallint,
233 "img_height" smallint,
234 "to_img_format" smallint DEFAULT '0' NOT NULL,
235 "to_img_layout" smallint DEFAULT '0' NOT NULL,
236 "to_img_type" smallint DEFAULT '0' NOT NULL,
237 "to_img_color" smallint DEFAULT '0' NOT NULL,
238 "icon_width" smallint,
239 "icon_height" smallint
241 INHERITS ("uploaded_media");
243 CREATE INDEX "idx_images_is_published__icon_i" on "images" using btree ( "is_published" "bool_ops", "icon_is_produced" "bool_ops" );
244 CREATE UNIQUE INDEX "idx_images_id" on "images" using btree ( "id" "int4_ops" );
250 CREATE TABLE "img_format" (
251 "id" smallint NOT NULL,
252 "name" character varying(20) NOT NULL,
253 "extension" character varying(10) NOT NULL,
254 "mimetype" character varying(40) NOT NULL,
255 "commment" character varying(255)
262 CREATE TABLE "img_layout" (
263 "id" smallint NOT NULL,
264 "name" character varying(20) NOT NULL
271 CREATE TABLE "img_type" (
272 "id" smallint NOT NULL,
273 "name" character varying(30) NOT NULL
280 CREATE TABLE "img_color" (
281 "id" smallint NOT NULL,
282 "name" character varying(30) NOT NULL
290 CREATE TABLE "audio" (
293 INHERITS ("uploaded_media");
295 CREATE INDEX "idx_audio_is_published_produced" on "audio" using btree ( "is_published" "bool_ops", "is_produced" "bool_ops" );
296 CREATE UNIQUE INDEX "idx_audio_id" on "audio" using btree ( "id" "int4_ops" );
302 CREATE TABLE "video" (
304 INHERITS ("uploaded_media");
306 CREATE INDEX "idx_video_is_published_produced" on "video" using btree ( "is_published" "bool_ops", "is_produced" "bool_ops" );
307 CREATE UNIQUE INDEX "idx_video_id" on "video" using btree ( "id" "int4_ops" );
313 CREATE TABLE "other_media" (
315 INHERITS ("uploaded_media");
317 CREATE INDEX "idx_othermedia_is_published_produced" on "other_media" using btree ( "is_published" "bool_ops", "is_produced" "bool_ops" );
318 CREATE UNIQUE INDEX "idx_othermedia_id" on "other_media" using btree ( "id" "int4_ops" );
324 CREATE TABLE "content" (
326 "is_html" boolean DEFAULT '0' NOT NULL,
327 "to_article_type" smallint DEFAULT '0' NOT NULL,
328 "to_content" integer,
333 CREATE INDEX "content_checksum_index" on "content" using btree ( "checksum" "int4_ops" );
334 CREATE INDEX "idx_content_to_article_type" on "content" using btree ( "to_article_type" "int2_ops" );
335 CREATE INDEX "idx_content_is_produced" on "content" using btree ( "is_produced" "bool_ops" );
336 CREATE INDEX "idx_content_is_published__to_ar" on "content" using btree ( "is_published" "bool_ops", "to_article_type" "int2_ops" );
337 CREATE INDEX "idx_content_is_published__id" on "content" using btree ( "is_published" "bool_ops", "id" "int4_ops" );
338 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" );
339 CREATE UNIQUE INDEX "idx_content_id" on "content" using btree ( "id" "int4_ops" );
340 CREATE INDEX "idx_content_is_published" on "content" using btree ( "is_published" "bool_ops" );
341 CREATE INDEX idx_content_webdb_create on content(webdb_create);
346 CREATE TABLE "content_x_media" (
347 "content_id" integer,
351 CREATE UNIQUE INDEX "idx_content_media" on "content_x_media" using btree ( "content_id" "int4_ops", "media_id" "int4_ops" );
352 CREATE UNIQUE INDEX "idx_media_content" on "content_x_media" using btree ( "media_id" "int4_ops", "content_id" "int4_ops" );
358 CREATE SEQUENCE "breaking_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
360 CREATE TABLE "breaking" (
361 "id" integer DEFAULT nextval('breaking_id_seq'::text) NOT NULL,
362 "text" character varying(255) NOT NULL,
363 "webdb_create" timestamp with time zone NOT NULL
370 CREATE SEQUENCE "messages_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
372 CREATE TABLE "messages" (
373 "id" integer DEFAULT nextval('messages_id_seq'::text) NOT NULL,
374 "title" character varying(30),
375 "description" character varying(255) NOT NULL,
376 "creator" character varying(30) NOT NULL,
377 "webdb_create" timestamp with time zone NOT NULL