-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d32e188
commit 6024bc6
Showing
19 changed files
with
200 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
\set ON_ERROR_STOP 1 | ||
|
||
BEGIN; | ||
|
||
DROP INDEX IF EXISTS edit_data_idx_link_type; | ||
|
||
CREATE INDEX edit_data_idx_link_type ON edit_data USING GIN ( | ||
array_remove(ARRAY[ | ||
(data#>>'{link_type,id}')::int, | ||
(data#>>'{link,link_type,id}')::int, | ||
(data#>>'{old,link_type,id}')::int, | ||
(data#>>'{new,link_type,id}')::int, | ||
(data#>>'{relationship,link,type,id}')::int | ||
], NULL) | ||
); | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\set ON_ERROR_STOP 1 | ||
|
||
BEGIN; | ||
|
||
ALTER TABLE link_type DROP COLUMN priority CASCADE; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
\set ON_ERROR_STOP 1 | ||
BEGIN; | ||
|
||
ALTER TABLE editor_collection_type -- Already dropped in mirror update script | ||
ADD CONSTRAINT allowed_collection_entity_type CHECK ( | ||
entity_type IN ('area', 'artist', 'event', 'genre', 'instrument', 'label', 'place', 'recording', 'release', 'release_group', 'series', 'work') | ||
); | ||
|
||
ALTER TABLE editor_collection_genre | ||
ADD CONSTRAINT editor_collection_genre_fk_collection | ||
FOREIGN KEY (collection) | ||
REFERENCES editor_collection(id), | ||
ADD CONSTRAINT editor_collection_genre_fk_genre | ||
FOREIGN KEY (genre) | ||
REFERENCES genre(id); | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
\set ON_ERROR_STOP 1 | ||
BEGIN; | ||
|
||
CREATE TABLE editor_collection_genre ( | ||
collection INTEGER NOT NULL, | ||
genre INTEGER NOT NULL, | ||
added TIMESTAMP WITH TIME ZONE DEFAULT NOW(), | ||
position INTEGER NOT NULL DEFAULT 0 CHECK (position >= 0), | ||
comment TEXT DEFAULT '' NOT NULL | ||
); | ||
|
||
ALTER TABLE editor_collection_genre ADD CONSTRAINT editor_collection_genre_pkey PRIMARY KEY (collection, genre); | ||
|
||
ALTER TABLE editor_collection_type | ||
DROP CONSTRAINT IF EXISTS allowed_collection_entity_type; | ||
|
||
INSERT INTO editor_collection_type (id, name, entity_type, parent, child_order, gid) | ||
VALUES (16, 'Genre', 'genre', NULL, 2, generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'editor_collection_type' || 16)); | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
\set ON_ERROR_STOP 1 | ||
|
||
BEGIN; | ||
|
||
ALTER TABLE label DROP CONSTRAINT IF EXISTS label_label_code_check; | ||
|
||
ALTER TABLE label DROP CONSTRAINT IF EXISTS label_code_length; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\set ON_ERROR_STOP 1 | ||
|
||
BEGIN; | ||
|
||
ALTER TABLE label ADD CONSTRAINT label_code_length CHECK (label_code > 0 AND label_code < 1000000); | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
-- Generated by CompileSchemaScripts.pl from: | ||
-- 20231005-edit-data-idx-link-type.sql | ||
-- 20240220-mbs-13403.sql | ||
-- 20240223-mbs-13421.sql | ||
-- 20240319-mbs-13514-mirror.sql | ||
\set ON_ERROR_STOP 1 | ||
BEGIN; | ||
SET search_path = musicbrainz, public; | ||
SET LOCAL statement_timeout = 0; | ||
-------------------------------------------------------------------------------- | ||
SELECT '20231005-edit-data-idx-link-type.sql'; | ||
|
||
|
||
DROP INDEX IF EXISTS edit_data_idx_link_type; | ||
|
||
CREATE INDEX edit_data_idx_link_type ON edit_data USING GIN ( | ||
array_remove(ARRAY[ | ||
(data#>>'{link_type,id}')::int, | ||
(data#>>'{link,link_type,id}')::int, | ||
(data#>>'{old,link_type,id}')::int, | ||
(data#>>'{new,link_type,id}')::int, | ||
(data#>>'{relationship,link,type,id}')::int | ||
], NULL) | ||
); | ||
|
||
-------------------------------------------------------------------------------- | ||
SELECT '20240220-mbs-13403.sql'; | ||
|
||
|
||
ALTER TABLE link_type DROP COLUMN priority CASCADE; | ||
|
||
-------------------------------------------------------------------------------- | ||
SELECT '20240223-mbs-13421.sql'; | ||
|
||
CREATE TABLE editor_collection_genre ( | ||
collection INTEGER NOT NULL, | ||
genre INTEGER NOT NULL, | ||
added TIMESTAMP WITH TIME ZONE DEFAULT NOW(), | ||
position INTEGER NOT NULL DEFAULT 0 CHECK (position >= 0), | ||
comment TEXT DEFAULT '' NOT NULL | ||
); | ||
|
||
ALTER TABLE editor_collection_genre ADD CONSTRAINT editor_collection_genre_pkey PRIMARY KEY (collection, genre); | ||
|
||
ALTER TABLE editor_collection_type | ||
DROP CONSTRAINT IF EXISTS allowed_collection_entity_type; | ||
|
||
INSERT INTO editor_collection_type (id, name, entity_type, parent, child_order, gid) | ||
VALUES (16, 'Genre', 'genre', NULL, 2, generate_uuid_v3('6ba7b8119dad11d180b400c04fd430c8', 'editor_collection_type' || 16)); | ||
|
||
-------------------------------------------------------------------------------- | ||
SELECT '20240319-mbs-13514-mirror.sql'; | ||
|
||
|
||
ALTER TABLE label DROP CONSTRAINT IF EXISTS label_label_code_check; | ||
|
||
ALTER TABLE label DROP CONSTRAINT IF EXISTS label_code_length; | ||
|
||
COMMIT; |
30 changes: 30 additions & 0 deletions
30
mbslave/sql/updates/schema-change/29.master_and_standalone.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
-- Generated by CompileSchemaScripts.pl from: | ||
-- 20240223-mbs-13421-fks.sql | ||
-- 20240319-mbs-13514.sql | ||
\set ON_ERROR_STOP 1 | ||
BEGIN; | ||
SET search_path = musicbrainz, public; | ||
SET LOCAL statement_timeout = 0; | ||
-------------------------------------------------------------------------------- | ||
SELECT '20240223-mbs-13421-fks.sql'; | ||
|
||
ALTER TABLE editor_collection_type -- Already dropped in mirror update script | ||
ADD CONSTRAINT allowed_collection_entity_type CHECK ( | ||
entity_type IN ('area', 'artist', 'event', 'genre', 'instrument', 'label', 'place', 'recording', 'release', 'release_group', 'series', 'work') | ||
); | ||
|
||
ALTER TABLE editor_collection_genre | ||
ADD CONSTRAINT editor_collection_genre_fk_collection | ||
FOREIGN KEY (collection) | ||
REFERENCES editor_collection(id), | ||
ADD CONSTRAINT editor_collection_genre_fk_genre | ||
FOREIGN KEY (genre) | ||
REFERENCES genre(id); | ||
|
||
-------------------------------------------------------------------------------- | ||
SELECT '20240319-mbs-13514.sql'; | ||
|
||
|
||
ALTER TABLE label ADD CONSTRAINT label_code_length CHECK (label_code > 0 AND label_code < 1000000); | ||
|
||
COMMIT; |