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
98436d99
Commit
98436d99
authored
Feb 13, 2020
by
Jason Goodman
Committed by
Toon Claes
Feb 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create operations_strategies and operations_scopes tables
For use with operations feature flags
parent
a3f1bde4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
0 deletions
+47
-0
changelogs/unreleased/feature-flag-strategy-scope-tables.yml
changelogs/unreleased/feature-flag-strategy-scope-tables.yml
+5
-0
db/migrate/20200210184410_create_operations_strategies_table.rb
...rate/20200210184410_create_operations_strategies_table.rb
+13
-0
db/migrate/20200210184420_create_operations_scopes_table.rb
db/migrate/20200210184420_create_operations_scopes_table.rb
+14
-0
db/schema.rb
db/schema.rb
+15
-0
No files found.
changelogs/unreleased/feature-flag-strategy-scope-tables.yml
0 → 100644
View file @
98436d99
---
title
:
Create operations strategies and scopes tables
merge_request
:
24819
author
:
type
:
added
db/migrate/20200210184410_create_operations_strategies_table.rb
0 → 100644
View file @
98436d99
# frozen_string_literal: true
class
CreateOperationsStrategiesTable
<
ActiveRecord
::
Migration
[
6.0
]
DOWNTIME
=
false
def
change
create_table
:operations_strategies
do
|
t
|
t
.
references
:feature_flag
,
index:
true
,
null:
false
,
foreign_key:
{
to_table: :operations_feature_flags
,
on_delete: :cascade
}
t
.
string
:name
,
null:
false
,
limit:
255
t
.
jsonb
:parameters
,
null:
false
,
default:
{}
end
end
end
db/migrate/20200210184420_create_operations_scopes_table.rb
0 → 100644
View file @
98436d99
# frozen_string_literal: true
class
CreateOperationsScopesTable
<
ActiveRecord
::
Migration
[
6.0
]
DOWNTIME
=
false
def
change
create_table
:operations_scopes
do
|
t
|
t
.
references
:strategy
,
null:
false
,
index:
false
,
foreign_key:
{
to_table: :operations_strategies
,
on_delete: :cascade
}
t
.
string
:environment_scope
,
null:
false
,
limit:
255
end
add_index
:operations_scopes
,
[
:strategy_id
,
:environment_scope
],
unique:
true
end
end
db/schema.rb
View file @
98436d99
...
...
@@ -2934,6 +2934,19 @@ ActiveRecord::Schema.define(version: 2020_02_12_052620) do
t
.
index
[
"project_id"
,
"token_encrypted"
],
name:
"index_feature_flags_clients_on_project_id_and_token_encrypted"
,
unique:
true
end
create_table
"operations_scopes"
,
force: :cascade
do
|
t
|
t
.
bigint
"strategy_id"
,
null:
false
t
.
string
"environment_scope"
,
limit:
255
,
null:
false
t
.
index
[
"strategy_id"
,
"environment_scope"
],
name:
"index_operations_scopes_on_strategy_id_and_environment_scope"
,
unique:
true
end
create_table
"operations_strategies"
,
force: :cascade
do
|
t
|
t
.
bigint
"feature_flag_id"
,
null:
false
t
.
string
"name"
,
limit:
255
,
null:
false
t
.
jsonb
"parameters"
,
default:
{},
null:
false
t
.
index
[
"feature_flag_id"
],
name:
"index_operations_strategies_on_feature_flag_id"
end
create_table
"packages_build_infos"
,
force: :cascade
do
|
t
|
t
.
integer
"package_id"
,
null:
false
t
.
integer
"pipeline_id"
...
...
@@ -4867,6 +4880,8 @@ ActiveRecord::Schema.define(version: 2020_02_12_052620) do
add_foreign_key
"operations_feature_flag_scopes"
,
"operations_feature_flags"
,
column:
"feature_flag_id"
,
on_delete: :cascade
add_foreign_key
"operations_feature_flags"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"operations_feature_flags_clients"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"operations_scopes"
,
"operations_strategies"
,
column:
"strategy_id"
,
on_delete: :cascade
add_foreign_key
"operations_strategies"
,
"operations_feature_flags"
,
column:
"feature_flag_id"
,
on_delete: :cascade
add_foreign_key
"packages_build_infos"
,
"ci_pipelines"
,
column:
"pipeline_id"
,
on_delete: :nullify
add_foreign_key
"packages_build_infos"
,
"packages_packages"
,
column:
"package_id"
,
on_delete: :cascade
add_foreign_key
"packages_conan_file_metadata"
,
"packages_package_files"
,
column:
"package_file_id"
,
on_delete: :cascade
...
...
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