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
4427005b
Commit
4427005b
authored
Apr 05, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Multiple issue assignees] fix migration for MySQL[ci skip]
parent
bd65eabe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
db/migrate/20170320171632_create_issue_assignees_table.rb
db/migrate/20170320171632_create_issue_assignees_table.rb
+12
-2
No files found.
db/migrate/20170320171632_create_issue_assignees_table.rb
View file @
4427005b
...
...
@@ -4,6 +4,8 @@
class
CreateIssueAssigneesTable
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
INDEX_NAME
=
'index_issue_assignees_on_issue_id_and_user_id'
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
...
...
@@ -23,12 +25,20 @@ class CreateIssueAssigneesTable < ActiveRecord::Migration
# comments:
# disable_ddl_transaction!
def
change
def
up
create_table
:issue_assignees
do
|
t
|
t
.
references
:user
,
foreign_key:
{
on_delete: :cascade
},
index:
true
,
null:
false
t
.
references
:issue
,
foreign_key:
{
on_delete: :cascade
},
null:
false
end
add_index
:issue_assignees
,
[
:issue_id
,
:user_id
],
unique:
true
add_index
:issue_assignees
,
[
:issue_id
,
:user_id
],
unique:
true
,
name:
INDEX_NAME
end
def
down
if
index_exists?
(
:issue_assignees
,
name:
INDEX_NAME
)
remove_index
:issue_assignees
,
name:
INDEX_NAME
end
drop_table
:issue_assignees
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