Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e320b933
Commit
e320b933
authored
Aug 11, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable datetime_with_timezone cop
parent
c882e763
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
db/migrate/20170811203342_fix_email_opted_in_at_on_users.rb
db/migrate/20170811203342_fix_email_opted_in_at_on_users.rb
+8
-1
No files found.
db/migrate/20170811203342_fix_email_opted_in_at_on_users.rb
View file @
e320b933
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment