Skip to content

Commit

Permalink
adjust down part for mysql 5
Browse files Browse the repository at this point in the history
  • Loading branch information
kathap committed Aug 8, 2024
1 parent 09a44dd commit cacc352
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
down do
if self.class.name.match?(/mysql/i)
VCAP::Migration.with_concurrent_timeout(self) do
# mysql 5 is not so smart as mysql 8, prevent Mysql2::Error: Duplicate key name 'name'
alter_table :quota_definitions do
drop_index :name, name: :name if @db.indexes(:quota_definitions).include?(:name)
end

alter_table :quota_definitions do
add_unique_constraint :name, name: :name
end
Expand Down

0 comments on commit cacc352

Please sign in to comment.