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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
81878170
Commit
81878170
authored
Nov 17, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extra subscribable_type filter on migration
parent
23f45e84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
db/migrate/20161031174110_migrate_subscriptions_project_id.rb
...igrate/20161031174110_migrate_subscriptions_project_id.rb
+3
-3
No files found.
db/migrate/20161031174110_migrate_subscriptions_project_id.rb
View file @
81878170
...
@@ -10,7 +10,7 @@ class MigrateSubscriptionsProjectId < ActiveRecord::Migration
...
@@ -10,7 +10,7 @@ class MigrateSubscriptionsProjectId < ActiveRecord::Migration
SET project_id = (
SET project_id = (
SELECT issues.project_id
SELECT issues.project_id
FROM issues
FROM issues
WHERE issues.id = subscriptions.subscribable_id
AND subscriptions.subscribable_type = 'Issue'
WHERE issues.id = subscriptions.subscribable_id
)
)
WHERE subscriptions.subscribable_type = 'Issue';
WHERE subscriptions.subscribable_type = 'Issue';
EOF
EOF
...
@@ -20,7 +20,7 @@ class MigrateSubscriptionsProjectId < ActiveRecord::Migration
...
@@ -20,7 +20,7 @@ class MigrateSubscriptionsProjectId < ActiveRecord::Migration
SET project_id = (
SET project_id = (
SELECT merge_requests.target_project_id
SELECT merge_requests.target_project_id
FROM merge_requests
FROM merge_requests
WHERE merge_requests.id = subscriptions.subscribable_id
AND subscriptions.subscribable_type = 'MergeRequest'
WHERE merge_requests.id = subscriptions.subscribable_id
)
)
WHERE subscriptions.subscribable_type = 'MergeRequest';
WHERE subscriptions.subscribable_type = 'MergeRequest';
EOF
EOF
...
@@ -30,7 +30,7 @@ class MigrateSubscriptionsProjectId < ActiveRecord::Migration
...
@@ -30,7 +30,7 @@ class MigrateSubscriptionsProjectId < ActiveRecord::Migration
SET project_id = (
SET project_id = (
SELECT projects.id
SELECT projects.id
FROM labels INNER JOIN projects ON projects.id = labels.project_id
FROM labels INNER JOIN projects ON projects.id = labels.project_id
WHERE labels.id = subscriptions.subscribable_id
AND subscriptions.subscribable_type = 'Label'
WHERE labels.id = subscriptions.subscribable_id
)
)
WHERE subscriptions.subscribable_type = 'Label';
WHERE subscriptions.subscribable_type = 'Label';
EOF
EOF
...
...
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