Commit e320b933 authored by Michael Kozono's avatar Michael Kozono

Disable datetime_with_timezone cop

parent c882e763
......@@ -8,8 +8,15 @@ class FixEmailOptedInAtOnUsers < ActiveRecord::Migration
DOWNTIME = false
def up
# MySQL makes the first TIMESTAMP column in a table default to
# CURRENT_TIMESTAMP and gives it a NOT NULL constraint
# (https://bugs.mysql.com/bug.php?id=75098). This prevents this value from
# ever being set to NULL. While it's possible to override MySQL's behavior
# in the the migration by adding null: true to add_column, this does not do
# the right thing when the database is initialized from scratch. Using the
# DATETIME type avoids these pitfalls.
remove_column :users, :email_opted_in_at
add_column :users, :email_opted_in_at, :datetime, null: true
add_column :users, :email_opted_in_at, :datetime, null: true # rubocop:disable Migration/Datetime
end
def down
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment