FIX: Migration to set column NOT NULL for delete_when_reminder_sent on bookmarks (#9696)
Also fix typo in original migration. Meta: https://meta.discourse.org/t/improved-bookmarks-with-reminders/144542/152?u=mjrbrennan
This commit is contained in:
parent
ef94b0f1a7
commit
e83dc75238
|
@ -2,6 +2,6 @@
|
|||
|
||||
class AddDeleteWhenReminderSentBooleanToBookmarks < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_column :bookmarks, :delete_when_reminder_sent, :boolean, nullabe: false, default: false
|
||||
add_column :bookmarks, :delete_when_reminder_sent, :boolean, null: false, default: false
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class EnsureBookmarkDeleteWhenReminderSentNotNull < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
DB.exec("UPDATE bookmarks SET delete_when_reminder_sent = false WHERE delete_when_reminder_sent IS NULL")
|
||||
change_column_null :bookmarks, :delete_when_reminder_sent, false
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue