diff options
Diffstat (limited to 'db/migrate/20221208122921_remove_constraints_from_ci_resources_for_partition_id.rb')
-rw-r--r-- | db/migrate/20221208122921_remove_constraints_from_ci_resources_for_partition_id.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20221208122921_remove_constraints_from_ci_resources_for_partition_id.rb b/db/migrate/20221208122921_remove_constraints_from_ci_resources_for_partition_id.rb new file mode 100644 index 00000000000..ffdd744b05c --- /dev/null +++ b/db/migrate/20221208122921_remove_constraints_from_ci_resources_for_partition_id.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveConstraintsFromCiResourcesForPartitionId < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + change_column_null :ci_resources, :partition_id, true + end + + def down + # no-op + # Adding back the not null constraint requires a long exclusive lock. + # Also depending on when it gets called, it might not even be possible to + # execute because the application could have inserted null values. + end +end |