BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c53d06c4
Commit
c53d06c4
authored
May 15, 2017
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dm-rename-column-concurrently-with-null' into 'master'
Disallow NULL on renamed column after default has been set See merge request !11396
parents
45c19a98
beec97f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
migration_helpers.rb
lib/gitlab/database/migration_helpers.rb
+2
-1
migration_helpers_spec.rb
spec/lib/gitlab/database/migration_helpers_spec.rb
+4
-2
No files found.
lib/gitlab/database/migration_helpers.rb
View file @
c53d06c4
...
...
@@ -283,7 +283,6 @@ module Gitlab
add_column
(
table
,
new
,
new_type
,
limit:
old_col
.
limit
,
null:
old_col
.
null
,
precision:
old_col
.
precision
,
scale:
old_col
.
scale
)
...
...
@@ -307,6 +306,8 @@ module Gitlab
update_column_in_batches
(
table
,
new
,
Arel
::
Table
.
new
(
table
)[
old
])
change_column_null
(
table
,
new
,
false
)
unless
old_col
.
null
copy_indexes
(
table
,
old
,
new
)
copy_foreign_keys
(
table
,
old
,
new
)
end
...
...
spec/lib/gitlab/database/migration_helpers_spec.rb
View file @
c53d06c4
...
...
@@ -382,7 +382,6 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
expect
(
model
).
to
receive
(
:add_column
).
with
(
:users
,
:new
,
:integer
,
limit:
old_column
.
limit
,
null:
old_column
.
null
,
precision:
old_column
.
precision
,
scale:
old_column
.
scale
)
...
...
@@ -391,6 +390,8 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
expect
(
model
).
to
receive
(
:update_column_in_batches
)
expect
(
model
).
to
receive
(
:change_column_null
).
with
(
:users
,
:new
,
false
)
expect
(
model
).
to
receive
(
:copy_indexes
).
with
(
:users
,
:old
,
:new
)
expect
(
model
).
to
receive
(
:copy_foreign_keys
).
with
(
:users
,
:old
,
:new
)
...
...
@@ -408,7 +409,6 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
expect
(
model
).
to
receive
(
:add_column
).
with
(
:users
,
:new
,
:integer
,
limit:
old_column
.
limit
,
null:
old_column
.
null
,
precision:
old_column
.
precision
,
scale:
old_column
.
scale
)
...
...
@@ -417,6 +417,8 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
expect
(
model
).
to
receive
(
:update_column_in_batches
)
expect
(
model
).
to
receive
(
:change_column_null
).
with
(
:users
,
:new
,
false
)
expect
(
model
).
to
receive
(
:copy_indexes
).
with
(
:users
,
:old
,
:new
)
expect
(
model
).
to
receive
(
:copy_foreign_keys
).
with
(
:users
,
:old
,
:new
)
...
...
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