Fix datetime format when migrating new notification settings on MySQL

parent 95ce4d29
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
class MigrateNewNotificationSetting < ActiveRecord::Migration class MigrateNewNotificationSetting < ActiveRecord::Migration
def up def up
timestamp = Time.now timestamp = Time.now.strftime('%F %T')
execute "INSERT INTO notification_settings ( user_id, source_id, source_type, level, created_at, updated_at ) SELECT user_id, source_id, source_type, notification_level, '#{timestamp}', '#{timestamp}' FROM members WHERE user_id IS NOT NULL" execute "INSERT INTO notification_settings ( user_id, source_id, source_type, level, created_at, updated_at ) SELECT user_id, source_id, source_type, notification_level, '#{timestamp}', '#{timestamp}' FROM members WHERE user_id IS NOT NULL"
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment