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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
e40b018b
Commit
e40b018b
authored
Oct 04, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a new migration to make sure that fast forward column exists in projects table
parent
416660c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
db/migrate/20150827121444_add_fast_forward_option_to_project.rb
...rate/20150827121444_add_fast_forward_option_to_project.rb
+3
-1
db/migrate/20171004121444_make_sure_fast_forward_option_exists.rb
...te/20171004121444_make_sure_fast_forward_option_exists.rb
+25
-0
db/schema.rb
db/schema.rb
+1
-1
No files found.
db/migrate/20150827121444_add_fast_forward_option_to_project.rb
View file @
e40b018b
...
@@ -12,6 +12,8 @@ class AddFastForwardOptionToProject < ActiveRecord::Migration
...
@@ -12,6 +12,8 @@ class AddFastForwardOptionToProject < ActiveRecord::Migration
end
end
def
down
def
down
remove_column
(
:projects
,
:merge_requests_ff_only_enabled
)
if
column_exists?
(
:projects
,
:merge_requests_ff_only_enabled
)
remove_column
(
:projects
,
:merge_requests_ff_only_enabled
)
end
end
end
end
end
db/migrate/20171004121444_make_sure_fast_forward_option_exists.rb
0 → 100644
View file @
e40b018b
# rubocop:disable all
class
MakeSureFastForwardOptionExists
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
disable_ddl_transaction!
def
up
# We had to fix the migration db/migrate/20150827121444_add_fast_forward_option_to_project.rb
# And this is why it's possible that someone has ran the migrations but does
# not have the merge_requests_ff_only_enabled column. This migration makes sure it will
# be added
unless
column_exists?
(
:projects
,
:merge_requests_ff_only_enabled
)
add_column_with_default
(
:projects
,
:merge_requests_ff_only_enabled
,
:boolean
,
default:
false
)
end
end
def
down
if
column_exists?
(
:projects
,
:merge_requests_ff_only_enabled
)
remove_column
(
:projects
,
:merge_requests_ff_only_enabled
)
end
end
end
db/schema.rb
View file @
e40b018b
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2017
0928100231
)
do
ActiveRecord
::
Schema
.
define
(
version:
2017
1004121444
)
do
# These are extensions that must be enabled in order to support this database
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"plpgsql"
...
...
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