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
d19f8fcc
Commit
d19f8fcc
authored
Aug 05, 2019
by
Alex Buijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change migration to rename concurrently
In order to prevent downtime, rename columns concurrently
parent
eb996dc3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
db/migrate/20190801193427_rename_application_settings_snowplow_collector_uri_column.rb
...ame_application_settings_snowplow_collector_uri_column.rb
+8
-5
db/post_migrate/20190802091750_cleanup_application_settings_snowplow_collector_uri_rename.rb
...nup_application_settings_snowplow_collector_uri_rename.rb
+17
-0
No files found.
db/migrate/20190801193427_rename_application_settings_snowplow_collector_uri_column.rb
View file @
d19f8fcc
# frozen_string_literal: true
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
RenameApplicationSettingsSnowplowCollectorUriColumn
<
ActiveRecord
::
Migration
[
5.2
]
class
RenameApplicationSettingsSnowplowCollectorUriColumn
<
ActiveRecord
::
Migration
[
5.2
]
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
DOWNTIME
=
false
def
change
disable_ddl_transaction!
rename_column
:application_settings
,
:snowplow_collector_uri
,
:snowplow_collector_hostname
def
up
rename_column_concurrently
:application_settings
,
:snowplow_collector_uri
,
:snowplow_collector_hostname
end
def
down
cleanup_concurrent_column_rename
:application_settings
,
:snowplow_collector_hostname
,
:snowplow_collector_uri
end
end
end
end
db/post_migrate/20190802091750_cleanup_application_settings_snowplow_collector_uri_rename.rb
0 → 100644
View file @
d19f8fcc
# frozen_string_literal: true
class
CleanupApplicationSettingsSnowplowCollectorUriRename
<
ActiveRecord
::
Migration
[
5.2
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
cleanup_concurrent_column_rename
:application_settings
,
:snowplow_collector_uri
,
:snowplow_collector_hostname
end
def
down
rename_column_concurrently
:application_settings
,
:snowplow_collector_hostname
,
:snowplow_collector_uri
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