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
2fdf15dd
Commit
2fdf15dd
authored
May 23, 2018
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edits create_project_mirror_data to add the new columns when table already exists
parent
acdb7435
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
db/migrate/20180502122856_create_project_mirror_data.rb
db/migrate/20180502122856_create_project_mirror_data.rb
+11
-7
No files found.
db/migrate/20180502122856_create_project_mirror_data.rb
View file @
2fdf15dd
...
...
@@ -4,8 +4,11 @@ class CreateProjectMirrorData < ActiveRecord::Migration
DOWNTIME
=
false
def
up
return
if
table_exists?
(
:project_mirror_data
)
if
table_exists?
(
:project_mirror_data
)
add_column
:project_mirror_data
,
:status
,
:string
unless
column_exists?
(
:project_mirror_data
,
:status
)
add_column
:project_mirror_data
,
:jid
,
:string
unless
column_exists?
(
:project_mirror_data
,
:jid
)
add_column
:project_mirror_data
,
:last_error
,
:text
unless
column_exists?
(
:project_mirror_data
,
:last_error
)
else
create_table
:project_mirror_data
do
|
t
|
t
.
references
:project
,
index:
true
,
foreign_key:
{
on_delete: :cascade
}
t
.
string
:status
...
...
@@ -13,6 +16,7 @@ class CreateProjectMirrorData < ActiveRecord::Migration
t
.
text
:last_error
end
end
end
def
down
drop_table
(
:project_mirror_data
)
if
table_exists?
(
:project_mirror_data
)
...
...
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