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
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
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,13 +4,17 @@ class CreateProjectMirrorData < ActiveRecord::Migration
...
@@ -4,13 +4,17 @@ class CreateProjectMirrorData < ActiveRecord::Migration
DOWNTIME
=
false
DOWNTIME
=
false
def
up
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
)
create_table
:project_mirror_data
do
|
t
|
add_column
:project_mirror_data
,
:jid
,
:string
unless
column_exists?
(
:project_mirror_data
,
:jid
)
t
.
references
:project
,
index:
true
,
foreign_key:
{
on_delete: :cascade
}
add_column
:project_mirror_data
,
:last_error
,
:text
unless
column_exists?
(
:project_mirror_data
,
:last_error
)
t
.
string
:status
else
t
.
string
:jid
create_table
:project_mirror_data
do
|
t
|
t
.
text
:last_error
t
.
references
:project
,
index:
true
,
foreign_key:
{
on_delete: :cascade
}
t
.
string
:status
t
.
string
:jid
t
.
text
:last_error
end
end
end
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