Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adapt migration for mysql5.7
Browse files Browse the repository at this point in the history
kathap committed Aug 30, 2024
1 parent 5e72cdd commit 3c1d718
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@
up do
if self.class.name.match?(/mysql/i)
alter_table :quota_definitions do
# rubocop:disable Sequel/ConcurrentIndex
# mysql 5 is not so smart as mysql 8
drop_index :name, name: :name if @db.indexes(:quota_definitions).include?(:name)
# rubocop:enable Sequel/ConcurrentIndex
drop_constraint :name, if_exists: true
end
elsif self.class.name.match?(/postgres/i)
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
include_context 'migration' do
let(:migration_filename) { '20240808118000_drop_unique_constraint_quota_definitions_name_key_spec.rb' }
end

describe 'up migration' do
context 'unique constraint on name column exists' do
it 'removes the unique constraint' do

0 comments on commit 3c1d718

Please sign in to comment.