diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-08 13:05:05 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-08 13:05:05 +0000 |
commit | 8fa311a5de24a28d8190b0a038fb893e71184eb2 (patch) | |
tree | ae489a4ab340f24312cc1d968f74e5b22ac094d4 /db | |
parent | 0fabe9336cf7cf2a31156931e716e84fc45e842f (diff) | |
download | gitlab-ce-8fa311a5de24a28d8190b0a038fb893e71184eb2.tar.gz |
Add latest changes from gitlab-org/gitlab@14-0-stable-ee
Diffstat (limited to 'db')
5 files changed, 47 insertions, 1 deletions
diff --git a/db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb b/db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb new file mode 100644 index 00000000000..ea612100e5a --- /dev/null +++ b/db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class InitializeConversionOfCiBuildsMetadataIdToBigint < ActiveRecord::Migration[6.1] + include Gitlab::Database::MigrationHelpers + + TABLE = :ci_builds_metadata + COLUMN = :id + + def up + initialize_conversion_of_integer_to_bigint(TABLE, COLUMN) + end + + def down + revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMN) + end +end diff --git a/db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb b/db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb new file mode 100644 index 00000000000..ecf9040eb46 --- /dev/null +++ b/db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class BackfillCiBuildsMetadataIdForBigintConversion < ActiveRecord::Migration[6.1] + include Gitlab::Database::MigrationHelpers + + TABLE = :ci_builds_metadata + COLUMN = :id + + def up + backfill_conversion_of_integer_to_bigint TABLE, COLUMN, batch_size: 15000, sub_batch_size: 100 + end + + def down + revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMN + end +end diff --git a/db/schema_migrations/20210705142714 b/db/schema_migrations/20210705142714 new file mode 100644 index 00000000000..7a64734b0e1 --- /dev/null +++ b/db/schema_migrations/20210705142714 @@ -0,0 +1 @@ +b47570ac9018a50206f239ffdafce2e672e6888a11a51e01f6d59d62a6a929af
\ No newline at end of file diff --git a/db/schema_migrations/20210705143150 b/db/schema_migrations/20210705143150 new file mode 100644 index 00000000000..9c91d772a41 --- /dev/null +++ b/db/schema_migrations/20210705143150 @@ -0,0 +1 @@ +9240ebbc69525a5bc1732f5e0ee2903f2b40b8693f24fcb911e72b5ba943357e
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 6de556b602f..64161ee7843 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -87,6 +87,15 @@ BEGIN END; $$; +CREATE FUNCTION trigger_542d6c2ad72e() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."id_convert_to_bigint" := NEW."id"; + RETURN NEW; +END; +$$; + CREATE FUNCTION trigger_69523443cc10() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -10559,7 +10568,8 @@ CREATE TABLE ci_builds_metadata ( environment_auto_stop_in character varying(255), expanded_environment_name character varying(255), secrets jsonb DEFAULT '{}'::jsonb NOT NULL, - build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_builds_metadata_id_seq @@ -25439,6 +25449,8 @@ CREATE TRIGGER trigger_490d204c00b3 BEFORE INSERT OR UPDATE ON ci_stages FOR EAC CREATE TRIGGER trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE FUNCTION trigger_51ab7cef8934(); +CREATE TRIGGER trigger_542d6c2ad72e BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_542d6c2ad72e(); + CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_69523443cc10(); CREATE TRIGGER trigger_77f5e1d20482 BEFORE INSERT OR UPDATE ON deployments FOR EACH ROW EXECUTE FUNCTION trigger_77f5e1d20482(); |