diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-24 01:34:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-24 01:34:10 +0300 |
commit | 96855c4214715fe718c02a308ddd0e4a3265b5d1 (patch) | |
tree | 1dd318ede0a420effd7d0eb41a980c4adc24fae5 /spec/migrations | |
parent | 5248069bd6ee923a76047fa74dee46155c40fa2b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/20210922021816_drop_int4_columns_for_ci_job_artifacts_spec.rb | 23 | ||||
-rw-r--r-- | spec/migrations/20210922082019_drop_int4_column_for_events_spec.rb | 21 |
2 files changed, 44 insertions, 0 deletions
diff --git a/spec/migrations/20210922021816_drop_int4_columns_for_ci_job_artifacts_spec.rb b/spec/migrations/20210922021816_drop_int4_columns_for_ci_job_artifacts_spec.rb new file mode 100644 index 00000000000..cf326cf0c0a --- /dev/null +++ b/spec/migrations/20210922021816_drop_int4_columns_for_ci_job_artifacts_spec.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration!('drop_int4_columns_for_ci_job_artifacts') + +RSpec.describe DropInt4ColumnsForCiJobArtifacts do + let(:ci_job_artifacts) { table(:ci_job_artifacts) } + + it 'correctly migrates up and down' do + reversible_migration do |migration| + migration.before -> { + expect(ci_job_artifacts.column_names).to include('id_convert_to_bigint') + expect(ci_job_artifacts.column_names).to include('job_id_convert_to_bigint') + } + + migration.after -> { + ci_job_artifacts.reset_column_information + expect(ci_job_artifacts.column_names).not_to include('id_convert_to_bigint') + expect(ci_job_artifacts.column_names).not_to include('job_id_convert_to_bigint') + } + end + end +end diff --git a/spec/migrations/20210922082019_drop_int4_column_for_events_spec.rb b/spec/migrations/20210922082019_drop_int4_column_for_events_spec.rb new file mode 100644 index 00000000000..412556fc283 --- /dev/null +++ b/spec/migrations/20210922082019_drop_int4_column_for_events_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration!('drop_int4_column_for_events') + +RSpec.describe DropInt4ColumnForEvents do + let(:events) { table(:events) } + + it 'correctly migrates up and down' do + reversible_migration do |migration| + migration.before -> { + expect(events.column_names).to include('id_convert_to_bigint') + } + + migration.after -> { + events.reset_column_information + expect(events.column_names).not_to include('id_convert_to_bigint') + } + end + end +end |