diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-02-08 15:25:11 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-02-08 15:25:11 +0000 |
commit | 64addce6c60c2580a878670f15f733f59477d98d (patch) | |
tree | 849ec1fc63b0eb1a22b5378cfd89efd6a26eda29 /db | |
parent | af5872b7d432f78befcb7e9f87187a5b82b588bf (diff) | |
download | redmine-64addce6c60c2580a878670f15f733f59477d98d.tar.gz redmine-64addce6c60c2580a878670f15f733f59477d98d.zip |
Fixed the migration for SQLServer (#18855).
git-svn-id: http://svn.redmine.org/redmine/trunk@13990 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20150208105930_replace_move_issues_permission.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/db/migrate/20150208105930_replace_move_issues_permission.rb b/db/migrate/20150208105930_replace_move_issues_permission.rb index 79ed506bc..18578f7da 100644 --- a/db/migrate/20150208105930_replace_move_issues_permission.rb +++ b/db/migrate/20150208105930_replace_move_issues_permission.rb @@ -3,8 +3,9 @@ class ReplaceMoveIssuesPermission < ActiveRecord::Migration Role.all.each do |role| if role.has_permission?(:edit_issues) && !role.has_permission?(:move_issues) # inserts one ligne per trakcer and status - WorkflowPermission.connection.insert_sql( - "INSERT INTO #{WorkflowPermission.table_name} (tracker_id, old_status_id, role_id, type, field_name, rule)" + + rule = WorkflowPermission.connection.quote_column_name('rule') # rule is a reserved keyword in SQLServer + WorkflowPermission.connection.execute( + "INSERT INTO #{WorkflowPermission.table_name} (tracker_id, old_status_id, role_id, type, field_name, #{rule})" + " SELECT t.id, s.id, #{role.id}, 'WorkflowPermission', 'project_id', 'readonly'" + " FROM #{Tracker.table_name} t, #{IssueStatus.table_name} s" ) |