change default value setting
change users migration not to lock the table by directly setting the default value of the accept_desktop_notifications colums when running the migration
This commit is contained in:
parent
17b0ea6111
commit
1c0a6b2138
|
|
@ -1,6 +1,6 @@
|
|||
class AddAcceptDesktopNotificationsToUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
execute("ALTER TABLE public.users ADD COLUMN accept_desktop_notifications BOOLEAN DEFAULT false;")
|
||||
execute("ALTER TABLE public.users ADD COLUMN accept_desktop_notifications BOOLEAN; UPDATE public.users SET accept_desktop_notifications = FALSE;")
|
||||
end
|
||||
def self.down
|
||||
execute("ALTER TABLE public.users DROP COLUMN accept_desktop_notifications;")
|
||||
|
|
|
|||
Loading…
Reference in New Issue