Skip to content

Commit

Permalink
Merge branch 'beta' into production
Browse files Browse the repository at this point in the history
* beta:
  Update POT files using the production database
  Update translations from Transifex
  MBS-12000: Fix error msg for incompatible entity (#2295)
  Update POT files using the production database
  Update translations from Transifex
  MBS-11998: Also include places on rating stats sum (#2291)
  MBS-11952: Autoselect Vimeo On Demand URLs correctly (#2262)
  MBS-11830: Add more collection statistics (#2198)
  Remove unneeded non-capturing groups
  MBS-11975: Clean up CDJapan detailview URLs
  MBS-10621 (2/2): Normalize and validate Tidal URLs
  Fix URL module alphabetical sort (again)
  MBS-10621 (1/2): Display Tidal URLs in the sidebar
  MBS-11959: Allow RYM links for music video recordings (#2261)
  MBS-11957: Clean up twitch.com to twitch.tv (#2260)
  MBS-11941: Normalize Worldcat identities URLs (#2257)
  MBS-11968: Allow LoC links for series
  MBS-11968: Allow DNB links for series
  MBS-11968: Autoselect and restrict VIAF for series
  MBS-11989: Also correct rg to release_group for delete_alias (#2286)
  Coding style: Restore multi-line strings indent
  MBS-11977 Fix targeting ENTITY for URL rel error
  Add URL error messages for mismatched entity types
  MBS-11973: Also load edits_pending for appears_on (#2278)
  MBS-11896: Remove the unique_primary_for_locale triggers and functions (#2266)
  Bump Flow to 0.160.2
  Also use localizeLanguageName for entity sidebars
  Update POT files using the production database
  Update translations from Transifex
  MBS-10902: Stop changing zxx language name at the Perl level (#2255)
  MBS-11961: Rename "random" in edit search since it's not random (#2264)
  MBS-11970: Add recaptcha.net to script-src CSP (#2271)
  MBS-11852: Only call TO_JSON on editor if it exists (#2246)
  Change EOSQL to SQL for TextMate/VSCode
  Re-enable running Perl::Critic now that errors are fixed
  Remove useless .js extensions in component_path
  Fix Perl::Critic useless interpolation and endspace in remaining files
  Fix Perl::Critic useless interpolation and endspace in Controller:: files
  Fix Perl::Critic useless interpolation and endspace in Form:: files
  Fix Perl::Critic useless interpolation in EditSearch:: files
  Fix Perl::Critic useless interpolation and endspace in Edit:: files
  Fix Perl::Critic useless interpolation and endspace in Report:: files
  Fix Perl::Critic useless interpolation in Script:: files
  Fix Perl::Critic useless interpolation in Sitemap:: files
  Fix Perl::Critic useless interpolation in WebService:: files
  Fix Perl::Critic useless interpolation in Entity:: files
  Fix Perl::Critic useless interpolation and endspace in Data:: files
  Fix Perl::Critic useless interpolation in Data::Role files
  Fix Perl::Critic useless interpolation in Data::Statistics
  MBS-11978: Move link action icons to the left (#2273)
  Add seeded links after any existing ones
  MBS-11960: Also assign seeded URL to rawURL
  Log copying JSON dump and search index dump to FTP
  Allow limiting compression threads from config
  Fix wrongly named "args" variable
  MBS-10639: Convert release merge edit to React
  • Loading branch information
reosarevok committed Oct 4, 2021
2 parents a78fc2d + 359c798 commit c9e811c
Show file tree
Hide file tree
Showing 551 changed files with 13,862 additions and 10,453 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Expand Up @@ -76,6 +76,7 @@ jobs:
--source Perl \
-I lib \
-j 9 \
t/critic.t \
t/pgtap/* \
t/pgtap/unused-tags/* \
t/script/MergeDuplicateArtistCredits.t \
Expand Down
8 changes: 4 additions & 4 deletions admin/CompileSchemaScripts.pl
Expand Up @@ -21,12 +21,12 @@
my $scripts = $upgrade_data->{$schema_version}->{$script_name};
my $filename = "$FindBin::Bin/sql/updates/schema-change/$schema_version.$script_name.sql";
my $data = join("\n", '-- Generated by CompileSchemaScripts.pl from:', map { '-- ' . $_ } @$scripts) . "\n";
$data .= <<~'EOSQL';
$data .= <<~'SQL';
\\set ON_ERROR_STOP 1
BEGIN;
SET search_path = musicbrainz, public;
SET LOCAL statement_timeout = 0;
EOSQL
SQL
for my $script (@$scripts) {
my @script_data = read_file("$FindBin::Bin/sql/updates/$script");
$data .= "--------------------------------------------------------------------------------\n";
Expand All @@ -37,8 +37,8 @@
}
}
}
$data .= <<~'EOSQL';
$data .= <<~'SQL';
COMMIT;
EOSQL
SQL
write_file($filename, \$data);
}
144 changes: 0 additions & 144 deletions admin/sql/CreateFunctions.sql
Expand Up @@ -1356,150 +1356,6 @@ BEGIN
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_area_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE area_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND area = NEW.area;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_artist_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE artist_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND artist = NEW.artist;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_event_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE event_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND event = NEW.event;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_genre_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE genre_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND genre = NEW.genre;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_instrument_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE instrument_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND instrument = NEW.instrument;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_label_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE label_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND label = NEW.label;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_place_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE place_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND place = NEW.place;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_recording_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE recording_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND recording = NEW.recording;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_release_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE release_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND release = NEW.release;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_release_group_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE release_group_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND release_group = NEW.release_group;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_series_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE series_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND series = NEW.series;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION unique_primary_work_alias()
RETURNS trigger AS $$
BEGIN
IF NEW.primary_for_locale THEN
UPDATE work_alias SET primary_for_locale = FALSE
WHERE locale = NEW.locale AND id != NEW.id
AND work = NEW.work;
END IF;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';

CREATE OR REPLACE FUNCTION simplify_search_hints()
RETURNS trigger AS $$
BEGIN
Expand Down
36 changes: 0 additions & 36 deletions admin/sql/CreateTriggers.sql
Expand Up @@ -10,9 +10,6 @@ CREATE TRIGGER b_upd_area_alias BEFORE UPDATE ON area_alias
CREATE TRIGGER b_upd_area_tag BEFORE UPDATE ON area_tag
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON area_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_area_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON area_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(3);

Expand Down Expand Up @@ -55,9 +52,6 @@ CREATE TRIGGER del_collection_sub_on_delete BEFORE DELETE ON editor_collection
CREATE TRIGGER del_collection_sub_on_private BEFORE UPDATE ON editor_collection
FOR EACH ROW EXECUTE PROCEDURE del_collection_sub_on_private();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON artist_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_artist_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON artist_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(3);

Expand Down Expand Up @@ -88,9 +82,6 @@ CREATE TRIGGER b_upd_event_alias BEFORE UPDATE ON event_alias
CREATE TRIGGER end_date_implies_ended BEFORE UPDATE OR INSERT ON event_alias
FOR EACH ROW EXECUTE PROCEDURE end_date_implies_ended();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON event_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_event_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON event_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(2);

Expand All @@ -103,9 +94,6 @@ CREATE TRIGGER b_upd_genre BEFORE UPDATE ON genre
CREATE TRIGGER b_upd_genre_alias BEFORE UPDATE ON genre_alias
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON genre_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_genre_alias();

CREATE TRIGGER b_upd_instrument BEFORE UPDATE ON instrument
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();

Expand All @@ -118,9 +106,6 @@ CREATE TRIGGER b_upd_instrument_alias BEFORE UPDATE ON instrument_alias
CREATE TRIGGER b_upd_instrument_tag BEFORE UPDATE ON instrument_tag
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON instrument_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_instrument_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON instrument_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(2);

Expand Down Expand Up @@ -340,9 +325,6 @@ CREATE TRIGGER end_date_implies_ended BEFORE UPDATE OR INSERT ON label_alias
CREATE TRIGGER b_upd_label_alias BEFORE UPDATE ON label_alias
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON label_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_label_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON label_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(2);

Expand Down Expand Up @@ -391,9 +373,6 @@ CREATE TRIGGER end_date_implies_ended BEFORE UPDATE OR INSERT ON place_alias
CREATE TRIGGER b_upd_place_alias BEFORE UPDATE ON place_alias
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON place_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_place_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON place_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(2);

Expand All @@ -418,9 +397,6 @@ CREATE TRIGGER end_date_implies_ended BEFORE UPDATE OR INSERT ON recording_alias
CREATE TRIGGER b_upd_recording_alias BEFORE UPDATE ON recording_alias
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON recording_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_recording_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON recording_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(2);

Expand All @@ -445,9 +421,6 @@ CREATE TRIGGER end_date_implies_ended BEFORE UPDATE OR INSERT ON release_alias
CREATE TRIGGER b_upd_release_alias BEFORE UPDATE ON release_alias
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON release_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_release_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON release_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(2);

Expand Down Expand Up @@ -508,9 +481,6 @@ CREATE TRIGGER end_date_implies_ended BEFORE UPDATE OR INSERT ON release_group_a
CREATE TRIGGER b_upd_release_group_alias BEFORE UPDATE ON release_group_alias
FOR EACH ROW EXECUTE PROCEDURE b_upd_last_updated_table();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON release_group_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_release_group_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON release_group_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(2);

Expand All @@ -529,9 +499,6 @@ CREATE TRIGGER b_upd_series_tag BEFORE UPDATE ON series_tag
CREATE TRIGGER end_date_implies_ended BEFORE UPDATE OR INSERT ON series_alias
FOR EACH ROW EXECUTE PROCEDURE end_date_implies_ended();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON series_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_series_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON series_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(2);

Expand Down Expand Up @@ -569,9 +536,6 @@ CREATE TRIGGER b_upd_work_alias BEFORE UPDATE ON work_alias
CREATE TRIGGER end_date_implies_ended BEFORE UPDATE OR INSERT ON work_alias
FOR EACH ROW EXECUTE PROCEDURE end_date_implies_ended();

CREATE TRIGGER unique_primary_for_locale BEFORE UPDATE OR INSERT ON work_alias
FOR EACH ROW EXECUTE PROCEDURE unique_primary_work_alias();

CREATE TRIGGER search_hint BEFORE UPDATE OR INSERT ON work_alias
FOR EACH ROW EXECUTE PROCEDURE simplify_search_hints(2);

Expand Down
12 changes: 0 additions & 12 deletions admin/sql/DropFunctions.sql
Expand Up @@ -102,17 +102,5 @@ DROP FUNCTION simplify_search_hints();
DROP FUNCTION track_count_matches_cdtoc(medium, int);
DROP FUNCTION trg_delete_unused_tag();
DROP FUNCTION trg_delete_unused_tag_ref();
DROP FUNCTION unique_primary_area_alias();
DROP FUNCTION unique_primary_artist_alias();
DROP FUNCTION unique_primary_event_alias();
DROP FUNCTION unique_primary_genre_alias();
DROP FUNCTION unique_primary_instrument_alias();
DROP FUNCTION unique_primary_label_alias();
DROP FUNCTION unique_primary_place_alias();
DROP FUNCTION unique_primary_recording_alias();
DROP FUNCTION unique_primary_release_alias();
DROP FUNCTION unique_primary_release_group_alias();
DROP FUNCTION unique_primary_series_alias();
DROP FUNCTION unique_primary_work_alias();
DROP FUNCTION whitespace_collapsed(TEXT);
DROP AGGREGATE array_accum (anyelement);

0 comments on commit c9e811c

Please sign in to comment.