diff options
author | Marco Wessel <marco@poop.nl> | 2015-02-23 02:31:12 +0100 |
---|---|---|
committer | Marco Wessel <marco@poop.nl> | 2015-02-23 03:36:21 +0100 |
commit | b19b8c679a136234094443e2d4a345f136a0bcc1 (patch) | |
tree | b4f52165e12f2bba47d7860c66429c90dfa507ca /db/migrate | |
parent | ebe0d34128c31bb88f6eb5aca96fae012c7fcf8b (diff) | |
download | gitlab-ce-b19b8c679a136234094443e2d4a345f136a0bcc1.tar.gz |
Give last_activity_at a default value so it will always be set
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20150223022001_set_missing_last_activity_at.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/db/migrate/20150223022001_set_missing_last_activity_at.rb b/db/migrate/20150223022001_set_missing_last_activity_at.rb new file mode 100644 index 00000000000..3a3adf18872 --- /dev/null +++ b/db/migrate/20150223022001_set_missing_last_activity_at.rb @@ -0,0 +1,9 @@ +class SetMissingLastActivityAt < ActiveRecord::Migration + def up + execute "UPDATE projects SET last_activity_at = updated_at WHERE last_activity_at IS NULL" + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end |