mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-03 05:29:42 +08:00
The change is sponsored by `Rails/AddColumnIndex` rubocop rule: > (…) add_column does not accept index, but also does not raise an error for extra keys, so it is possible to mistakenly add the key without realizing it will not actually add an index. I opted not to add these "missing" indexes since they've proven not necessary after all.
12 lines
367 B
Ruby
12 lines
367 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddDeleteOptionToBookmarks < ActiveRecord::Migration[6.0]
|
|
def up
|
|
add_column :bookmarks, :auto_delete_preference, :integer, null: false, default: 0
|
|
DB.exec("UPDATE bookmarks SET auto_delete_preference = 1 WHERE delete_when_reminder_sent")
|
|
end
|
|
|
|
def down
|
|
remove_column :bookmarks, :auto_delete_preference
|
|
end
|
|
end
|