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
ba2f8a6c
Unverified
Commit
ba2f8a6c
authored
Mar 01, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make project#namespace_id not null
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
71545ca6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
20180301084653_change_project_namespace_id_not_null.rb
...te/20180301084653_change_project_namespace_id_not_null.rb
+29
-0
No files found.
db/post_migrate/20180301084653_change_project_namespace_id_not_null.rb
0 → 100644
View file @
ba2f8a6c
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
ChangeProjectNamespaceIdNotNull
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
class
Project
<
ActiveRecord
::
Base
self
.
table_name
=
'projects'
include
EachBatch
end
BATCH_SIZE
=
1000
DOWNTIME
=
false
disable_ddl_transaction!
def
up
Project
.
where
(
namespace_id:
nil
).
each_batch
(
of:
BATCH_SIZE
)
do
|
batch
|
batch
.
delete_all
end
change_column_null
:projects
,
:namespace_id
,
false
end
def
down
change_column_null
:projects
,
:namespace_id
,
true
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