diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-11-21 16:52:57 +0300 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-11-21 17:02:23 +0300 |
commit | 4053c055beb7d88f9e22ca4187b9868a40030b00 (patch) | |
tree | ae9e0c31300dc8251073ce930626dbe16b5c6bc0 /db/migrate | |
parent | 1b34a24ffd63ac9a5a37ac0edbf3a3f2ca6d1810 (diff) |
Add missing timestamps to the 'members' table
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20141121133009_add_timestamps_to_members.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20141121133009_add_timestamps_to_members.rb b/db/migrate/20141121133009_add_timestamps_to_members.rb new file mode 100644 index 00000000000..ef6d4dedf32 --- /dev/null +++ b/db/migrate/20141121133009_add_timestamps_to_members.rb @@ -0,0 +1,15 @@ +# In 20140914145549_migrate_to_new_members_model.rb we forgot to set the +# created_at and updated_at times for new records in the 'members' table. This +# became a problem after commit c8e78d972a5a628870eefca0f2ccea0199c55bda which +# was added in GitLab 7.5. With this migration we ensure that all rows in +# 'members' have at least some created_at and updated_at timestamp. +class AddTimestampsToMembers < ActiveRecord::Migration + def up + execute "UPDATE members SET created_at = NOW() WHERE created_at is NULL" + execute "UPDATE members SET updated_at = NOW() WHERE updated_at is NULL" + end + + def down + # no change + end +end |