mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
Fixed the migration for SQLServer (#18855).
git-svn-id: http://svn.redmine.org/redmine/trunk@13990 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
af5872b7d4
commit
64addce6c6
@ -3,8 +3,9 @@ class ReplaceMoveIssuesPermission < ActiveRecord::Migration
|
|||||||
Role.all.each do |role|
|
Role.all.each do |role|
|
||||||
if role.has_permission?(:edit_issues) && !role.has_permission?(:move_issues)
|
if role.has_permission?(:edit_issues) && !role.has_permission?(:move_issues)
|
||||||
# inserts one ligne per trakcer and status
|
# inserts one ligne per trakcer and status
|
||||||
WorkflowPermission.connection.insert_sql(
|
rule = WorkflowPermission.connection.quote_column_name('rule') # rule is a reserved keyword in SQLServer
|
||||||
"INSERT INTO #{WorkflowPermission.table_name} (tracker_id, old_status_id, role_id, type, field_name, rule)" +
|
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'" +
|
" SELECT t.id, s.id, #{role.id}, 'WorkflowPermission', 'project_id', 'readonly'" +
|
||||||
" FROM #{Tracker.table_name} t, #{IssueStatus.table_name} s"
|
" FROM #{Tracker.table_name} t, #{IssueStatus.table_name} s"
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user