Skip to content

Commit

Permalink
Use CURRENT_TIMESTAMP as the default value for created_at
Browse files Browse the repository at this point in the history
* 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]
  • Loading branch information
sujoybasu committed Dec 23, 2014
1 parent 4983dff commit bb642ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cloud_controller/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb642ff

Please sign in to comment.