Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
08d3fd49656e
Commit
41365ab4
authored
Feb 02, 2018
by
James Lopez
Committed by
Stan Hu
Feb 02, 2018
Browse files
add migration
parent
262fc3beb42e
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/post_migrate/20180202111106_remove_project_labels_group_id.rb
0 → 100644
View file @
08d3fd49
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
RemoveProjectLabelsGroupId
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
update_column_in_batches
(
:labels
,
:group_id
,
nil
)
do
|
table
,
query
|
query
.
where
(
table
[
:type
].
eq
(
'ProjectLabel'
).
and
(
table
[
:group_id
].
not_eq
(
nil
)))
end
end
def
down
end
end
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