fix mysql migrations
This commit is contained in:
@@ -6,7 +6,8 @@ class CreateLockEvents < ActiveRecord::Migration[8.0]
|
|||||||
t.string :key, index: true, null: false
|
t.string :key, index: true, null: false
|
||||||
t.string :event_name, null: false
|
t.string :event_name, null: false
|
||||||
|
|
||||||
t.index %i[event_name key], unique: adapter_name != 'Mysql2', where: "event_name IN ('start', 'complete')"
|
t.index %i[event_name key], unique: connection.supports_partial_index?,
|
||||||
|
where: "event_name IN ('start', 'complete')"
|
||||||
|
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class AddIsFirstToCompletedSubmitters < ActiveRecord::Migration[8.0]
|
|||||||
where: 'is_first = TRUE',
|
where: 'is_first = TRUE',
|
||||||
name: 'index_completed_submitters_account_id_completed_at_is_first'
|
name: 'index_completed_submitters_account_id_completed_at_is_first'
|
||||||
|
|
||||||
add_index :completed_submitters, :submission_id, unique: adapter_name != 'Mysql2',
|
add_index :completed_submitters, :submission_id, unique: connection.supports_partial_index?,
|
||||||
where: 'is_first = TRUE'
|
where: 'is_first = TRUE'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user