Fix datetime format when migrating new notification settings on MySQL

This commit is contained in:
Douglas Barbosa Alexandre 2016-04-14 18:46:18 -03:00
parent 95ce4d29c3
commit 70c9ceb7b1
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@
#
class MigrateNewNotificationSetting < ActiveRecord::Migration
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"
end