Ticket #984: dgu-upgrade.diff

File dgu-upgrade.diff, 3.0 KB (added by kindly, 3 years ago)

dgu update

Line 
1
2ALTER TABLE group_extra_revision
3        DROP CONSTRAINT group_extra_revision_pkey;
4
5ALTER TABLE group_revision
6        DROP CONSTRAINT group_revision_pkey;
7
8ALTER TABLE package_group_revision
9        DROP CONSTRAINT package_group_revision_pkey;
10
11ALTER TABLE group_extra
12        DROP CONSTRAINT group_extra_revision_fkey;
13
14ALTER TABLE group_extra_revision
15        DROP CONSTRAINT group_extra_revision_continuity_id_fkey;
16
17ALTER TABLE group_revision
18        DROP CONSTRAINT group_revision_name_key;
19
20ALTER TABLE package_group
21        DROP CONSTRAINT package_group_revision_fkey;
22
23ALTER TABLE package_group_revision
24        DROP CONSTRAINT package_group_revision_continuity_id_fkey;
25
26ALTER TABLE authorization_group_role
27        DROP COLUMN id;
28
29ALTER TABLE changeset
30        DROP COLUMN status;
31
32update package_group_revision set continuity_id = id;
33
34ALTER TABLE group_extra_revision
35        ALTER COLUMN revision_id SET NOT NULL;
36
37ALTER TABLE group_revision
38        ALTER COLUMN revision_id SET NOT NULL;
39
40ALTER TABLE harvesting_job
41        ALTER COLUMN status SET NOT NULL;
42
43ALTER TABLE migrate_version
44        ALTER COLUMN repository_id TYPE character varying(250) /* TYPE change - table: migrate_version original: character varying(255) new: character varying(250) */;
45
46ALTER TABLE package
47        ALTER COLUMN license_id TYPE text /* TYPE change - table: package original: character varying(100) new: text */;
48
49ALTER TABLE package_group_revision
50        ALTER COLUMN revision_id SET NOT NULL;
51
52ALTER TABLE package_revision
53        ALTER COLUMN license_id TYPE text /* TYPE change - table: package_revision original: character varying(100) new: text */;
54
55ALTER TABLE rating
56        ALTER COLUMN rating TYPE double precision /* TYPE change - table: rating original: real new: double precision */;
57
58ALTER TABLE group_extra_revision
59        ADD CONSTRAINT group_extra_revision_pkey PRIMARY KEY (id, revision_id);
60
61ALTER TABLE group_revision
62        ADD CONSTRAINT group_revision_pkey PRIMARY KEY (id, revision_id);
63
64ALTER TABLE package_group_revision
65        ADD CONSTRAINT package_group_revision_pkey PRIMARY KEY (id, revision_id);
66
67ALTER TABLE group_extra
68        ADD CONSTRAINT group_extra_revision_id_fkey FOREIGN KEY (revision_id) REFERENCES revision(id);
69
70ALTER TABLE group_extra_revision
71        ADD CONSTRAINT group_extra_revision_continuity_id_fkey FOREIGN KEY (continuity_id) REFERENCES group_extra(id);
72
73ALTER TABLE group_revision
74        ADD CONSTRAINT group_revision_continuity_id_fkey FOREIGN KEY (continuity_id) REFERENCES "group"(id);
75
76ALTER TABLE harvested_document
77        ADD CONSTRAINT harvested_document_package_id_fkey FOREIGN KEY (package_id) REFERENCES package(id);
78
79ALTER TABLE harvested_document
80        ADD CONSTRAINT harvested_document_source_id_fkey FOREIGN KEY (source_id) REFERENCES harvest_source(id);
81
82ALTER TABLE package_group
83        ADD CONSTRAINT package_group_revision_id_fkey FOREIGN KEY (revision_id) REFERENCES revision(id);
84
85ALTER TABLE package_group_revision
86        ADD CONSTRAINT package_group_revision_continuity_id_fkey FOREIGN KEY (continuity_id) REFERENCES package_group(id);
87
88ALTER TABLE user_object_role
89        ADD CONSTRAINT user_object_role_authorized_group_id_fkey FOREIGN KEY (authorized_group_id) REFERENCES authorization_group(id);