mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 05:34:03 +08:00
Remove use of rescue nil
in migration.
This commit is contained in:
parent
eccfab6a19
commit
0984763013
|
@ -2,7 +2,7 @@ class AddPublicTypeToTopicTimers < ActiveRecord::Migration
|
|||
def up
|
||||
add_column :topic_timers, :public_type, :boolean, default: true
|
||||
|
||||
execute("drop index idx_topic_id_status_type_deleted_at") rescue nil
|
||||
execute("DROP INDEX IF EXISTS idx_topic_id_status_type_deleted_at")
|
||||
|
||||
# Only one public timer per topic (close, open, delete):
|
||||
execute <<~SQL
|
||||
|
@ -14,7 +14,7 @@ class AddPublicTypeToTopicTimers < ActiveRecord::Migration
|
|||
end
|
||||
|
||||
def down
|
||||
execute "DROP INDEX idx_topic_id_public_type_deleted_at"
|
||||
execute "DROP INDEX IF EXISTS idx_topic_id_public_type_deleted_at"
|
||||
|
||||
execute <<~SQL
|
||||
CREATE UNIQUE INDEX idx_topic_id_status_type_deleted_at
|
||||
|
|
Loading…
Reference in New Issue
Block a user