some javadoc additions some early work on the new producer node to report changes...
[mir.git] / dbscripts / updates / update20031212.sql
1 -- update script 2003-12-12 by rk
2 --
3 -- * makes login unique on webdb_users
4
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
11 -- 
12 -- Application of this scripts requires tomcat restart
13 -- because media_type is cached
14 --
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.
17 --
18
19 BEGIN TRANSACTION;
20
21 ALTER TABLE "webdb_users" ADD CONSTRAINT "webdb_users_login_key" UNIQUE (login);
22
23 --
24 -- ogg format support
25 -- 
26
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');
31
32 --
33 -- topic index double
34 --
35 DROP INDEX "idx_topic_id";
36
37 --
38 -- comment index double
39 --
40 DROP INDEX "idx_comment_id";
41
42
43 --
44 -- recreate indexes on cxm
45 --
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" );
50
51 --
52 -- that's it!
53   
54 COMMIT TRANSACTION;
55 ANALYZE "content_x_media";
56