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
1382739d
Commit
1382739d
authored
Aug 27, 2020
by
Amy Troschinetz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure migration is idempotent
parent
7bda030d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
db/migrate/20200820204041_create_ci_platform_metrics.rb
db/migrate/20200820204041_create_ci_platform_metrics.rb
+7
-3
No files found.
db/migrate/20200820204041_create_ci_platform_metrics.rb
View file @
1382739d
...
...
@@ -4,6 +4,7 @@ class CreateCiPlatformMetrics < ActiveRecord::Migration[6.0]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
CI_VARIABLES_KEY_INDEX_NAME
=
"index_ci_variables_on_key"
disable_ddl_transaction!
...
...
@@ -17,11 +18,14 @@ class CreateCiPlatformMetrics < ActiveRecord::Migration[6.0]
end
add_text_limit
:ci_platform_metrics
,
:platform_target
,
255
add_concurrent_index
:ci_variables
,
:key
add_concurrent_index
:ci_variables
,
:key
,
name:
CI_VARIABLES_KEY_INDEX_NAME
end
def
down
drop_table
:ci_platform_metrics
remove_concurrent_index
:ci_variables
,
:key
,
name:
'index_ci_variables_on_key'
if
table_exists?
(
:ci_platform_metrics
)
drop_table
:ci_platform_metrics
end
remove_concurrent_index
:ci_variables
,
:key
,
name:
CI_VARIABLES_KEY_INDEX_NAME
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