1 -- update script 2003-12-12 by rk
3 -- * makes login unique on webdb_users
5 -- * drops unnecessary index on webdb_users
6 -- * inserts a line for ogg support in media_types
7 -- * drop "- deprecated -" from media_types
8 -- * drop redundant index on id of topic
9 -- * drop redundant index on id of comment
10 -- * recreate indexes on content_x_media
12 -- Application of this scripts requires tomcat restart
13 -- because media_type is cached
15 -- This script will terminate with an error the second time it's run,
16 -- so running this script when it isn't needed can't do any harm.
21 ALTER TABLE "webdb_users" ADD CONSTRAINT "webdb_users_login_key" UNIQUE (login);
27 DELETE FROM "media_type" WHERE mime_type='- deprecated -';
28 DELETE FROM "media_type" WHERE mime_type='application/x-ogg';
29 INSERT INTO "media_type" ("name", "mime_type", "classname","tablename")
30 VALUES ('ogg', 'application/x-ogg', 'Ogg', 'Audio');
35 DROP INDEX "idx_topic_id";
38 -- comment index double
40 DROP INDEX "idx_comment_id";
44 -- recreate indexes on cxm
46 DROP INDEX "idx_content_media";
47 DROP INDEX "idx_media_content";
48 CREATE INDEX "idx_cxm_content" ON "content_x_media" using btree ( "content_id" "int4_ops" );
49 CREATE INDEX "idx_cxm_media" ON "content_x_media" using btree ( "media_id" "int4_ops" );
55 ANALYZE "content_x_media";