15112: Fill in missing modified_at values from before #14595.
authorTom Clegg <tclegg@veritasgenetics.com>
Mon, 22 Apr 2019 15:29:31 +0000 (11:29 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Mon, 22 Apr 2019 15:29:31 +0000 (11:29 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

services/api/db/migrate/20190422144631_fill_missing_modified_at.rb [new file with mode: 0644]

diff --git a/services/api/db/migrate/20190422144631_fill_missing_modified_at.rb b/services/api/db/migrate/20190422144631_fill_missing_modified_at.rb
new file mode 100644 (file)
index 0000000..5075e48
--- /dev/null
@@ -0,0 +1,11 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+class FillMissingModifiedAt < ActiveRecord::Migration[5.0]
+  def up
+    Collection.where('modified_at is null').update_all('modified_at = created_at')
+  end
+  def down
+  end
+end