From bb642ffdca7926adcfafaeb53afa000cbbc63b76 Mon Sep 17 00:00:00 2001 From: James Myers and Sujoy Basu Date: Mon, 22 Dec 2014 16:05:31 -0800 Subject: [PATCH] Use CURRENT_TIMESTAMP as the default value for created_at * Mysql 5.6 on AWS RDS sets `--explicit_defaults_for_timestamp`, causing errors for created_at when no default value is set, this provides a sane default value, it should not change behavior as Sequel sends a value for created_at [#78499982] --- lib/cloud_controller/db.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cloud_controller/db.rb b/lib/cloud_controller/db.rb index f6ee57c48c1..82c1d464eac 100644 --- a/lib/cloud_controller/db.rb +++ b/lib/cloud_controller/db.rb @@ -85,7 +85,7 @@ module Migration def self.timestamps(migration, table_key) created_at_idx = "#{table_key}_created_at_index".to_sym if table_key updated_at_idx = "#{table_key}_updated_at_index".to_sym if table_key - migration.Timestamp :created_at, :null => false + migration.Timestamp :created_at, :null => false, :default => Sequel::CURRENT_TIMESTAMP migration.Timestamp :updated_at migration.index :created_at, :name => created_at_idx migration.index :updated_at, :name => updated_at_idx