Merge branch '8784-dir-listings'
[arvados.git] / services / api / db / migrate / 20140421151940_timestamps_not_null.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 class TimestampsNotNull < ActiveRecord::Migration
6   def up
7     ActiveRecord::Base.connection.tables.each do |t|
8       next if t == 'schema_migrations'
9       change_column t.to_sym, :created_at, :datetime, :null => false
10       change_column t.to_sym, :updated_at, :datetime, :null => false
11     end
12   end
13   def down
14     # There might have been a NULL constraint before this, depending
15     # on the version of Rails used to build the database.
16   end
17 end