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
2e19d8ff
Commit
2e19d8ff
authored
Sep 22, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use concurrent way of adding foreign keys
parent
80496129
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
13 deletions
+25
-13
db/migrate/20170921154104_create_board_filters_table.rb
db/migrate/20170921154104_create_board_filters_table.rb
+8
-4
db/migrate/20170921203824_create_board_filter_labels.rb
db/migrate/20170921203824_create_board_filter_labels.rb
+11
-3
db/schema.rb
db/schema.rb
+6
-6
No files found.
db/migrate/20170921154104_create_board_filters_table.rb
View file @
2e19d8ff
class
CreateBoardFiltersTable
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
create_table
:board_filters
do
|
t
|
t
.
integer
:board_id
,
null:
false
,
index:
true
...
...
@@ -11,10 +15,10 @@ class CreateBoardFiltersTable < ActiveRecord::Migration
t
.
integer
:assignee_id
,
index:
true
end
add_foreign_key
:board_filters
,
:boards
,
column: :board_id
,
on_delete: :cascade
add_foreign_key
:board_filters
,
:milestones
,
column: :milestone_id
,
on_delete: :nullify
add_foreign_key
:board_filters
,
:users
,
column: :author_id
,
on_delete: :nullify
add_foreign_key
:board_filters
,
:users
,
column: :assignee_id
,
on_delete: :nullify
add_
concurrent_
foreign_key
:board_filters
,
:boards
,
column: :board_id
,
on_delete: :cascade
add_
concurrent_
foreign_key
:board_filters
,
:milestones
,
column: :milestone_id
,
on_delete: :nullify
add_
concurrent_
foreign_key
:board_filters
,
:users
,
column: :author_id
,
on_delete: :nullify
add_
concurrent_
foreign_key
:board_filters
,
:users
,
column: :assignee_id
,
on_delete: :nullify
end
def
down
...
...
db/migrate/20170921203824_create_board_filter_labels.rb
View file @
2e19d8ff
class
CreateBoardFilterLabels
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
change
disable_ddl_transaction!
def
up
create_table
:board_filter_labels
do
|
t
|
t
.
integer
:board_filter_id
,
null:
false
,
index:
true
t
.
integer
:label_id
,
null:
false
,
index:
true
end
add_foreign_key
:board_filter_labels
,
:board_filters
,
column: :board_filter_id
,
on_delete: :cascade
add_foreign_key
:board_filter_labels
,
:labels
,
column: :label_id
,
on_delete: :cascade
add_concurrent_foreign_key
:board_filter_labels
,
:board_filters
,
column: :board_filter_id
,
on_delete: :cascade
add_concurrent_foreign_key
:board_filter_labels
,
:labels
,
column: :label_id
,
on_delete: :cascade
end
def
down
drop_table
:board_filter_labels
end
end
db/schema.rb
View file @
2e19d8ff
...
...
@@ -2069,12 +2069,12 @@ ActiveRecord::Schema.define(version: 20170921203824) do
add_foreign_key
"approvals"
,
"merge_requests"
,
name:
"fk_310d714958"
,
on_delete: :cascade
add_foreign_key
"approver_groups"
,
"namespaces"
,
column:
"group_id"
,
on_delete: :cascade
add_foreign_key
"board_filter_labels"
,
"board_filters"
,
on_delete: :cascade
add_foreign_key
"board_filter_labels"
,
"labels"
,
on_delete: :cascade
add_foreign_key
"board_filters"
,
"boards"
,
on_delete: :cascade
add_foreign_key
"board_filters"
,
"milestones"
,
on_delete: :nullify
add_foreign_key
"board_filters"
,
"users"
,
column:
"assignee_id"
,
on_delete: :nullify
add_foreign_key
"board_filters"
,
"users"
,
column:
"author_id"
,
on_delete: :nullify
add_foreign_key
"board_filter_labels"
,
"board_filters"
,
name:
"fk_ebc90d2f1a"
,
on_delete: :cascade
add_foreign_key
"board_filter_labels"
,
"labels"
,
name:
"fk_91e18fdcee"
,
on_delete: :cascade
add_foreign_key
"board_filters"
,
"boards"
,
name:
"fk_87e919b0eb"
,
on_delete: :cascade
add_foreign_key
"board_filters"
,
"milestones"
,
name:
"fk_37d28eeebc"
,
on_delete: :nullify
add_foreign_key
"board_filters"
,
"users"
,
column:
"assignee_id"
,
name:
"fk_e7893dfa6e"
,
on_delete: :nullify
add_foreign_key
"board_filters"
,
"users"
,
column:
"author_id"
,
name:
"fk_b341da4d2b"
,
on_delete: :nullify
add_foreign_key
"boards"
,
"namespaces"
,
column:
"group_id"
,
name:
"fk_1e9a074a35"
,
on_delete: :cascade
add_foreign_key
"boards"
,
"projects"
,
name:
"fk_f15266b5f9"
,
on_delete: :cascade
add_foreign_key
"chat_teams"
,
"namespaces"
,
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