##// END OF EJS Templates
Fixed the migration for SQLServer (#18855)....
Jean-Philippe Lang -
r13608:64addce6c60c
parent child
Show More
@@ -3,8 +3,9 class ReplaceMoveIssuesPermission < ActiveRecord::Migration
3 Role.all.each do |role|
3 Role.all.each do |role|
4 if role.has_permission?(:edit_issues) && !role.has_permission?(:move_issues)
4 if role.has_permission?(:edit_issues) && !role.has_permission?(:move_issues)
5 # inserts one ligne per trakcer and status
5 # inserts one ligne per trakcer and status
6 WorkflowPermission.connection.insert_sql(
6 rule = WorkflowPermission.connection.quote_column_name('rule') # rule is a reserved keyword in SQLServer
7 "INSERT INTO #{WorkflowPermission.table_name} (tracker_id, old_status_id, role_id, type, field_name, rule)" +
7 WorkflowPermission.connection.execute(
8 "INSERT INTO #{WorkflowPermission.table_name} (tracker_id, old_status_id, role_id, type, field_name, #{rule})" +
8 " SELECT t.id, s.id, #{role.id}, 'WorkflowPermission', 'project_id', 'readonly'" +
9 " SELECT t.id, s.id, #{role.id}, 'WorkflowPermission', 'project_id', 'readonly'" +
9 " FROM #{Tracker.table_name} t, #{IssueStatus.table_name} s"
10 " FROM #{Tracker.table_name} t, #{IssueStatus.table_name} s"
10 )
11 )
General Comments 0
You need to be logged in to leave comments. Login now