qoute a table name
refs CNVS-21900 Change-Id: I4cd227dfbf9a98671dbd0b1f6d9c6d031d619392 Reviewed-on: https://gerrit.instructure.com/68521 Tested-by: Jenkins Reviewed-by: Rob Orton <rob@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
4d7060547d
commit
b7ea9c1282
|
@ -24,7 +24,7 @@ module Importers
|
|||
migration.context.assignments
|
||||
assignments.each_with_index{|m, idx| cases << " WHEN migration_id=#{conn.quote(m['assignment_id'])} THEN #{max + idx + 1} " if m['assignment_id'] }
|
||||
unless cases.empty?
|
||||
conn.execute("UPDATE assignments SET position=CASE #{cases.join(' ')} ELSE NULL END WHERE context_id=#{migration.context.id} AND context_type=#{conn.quote(migration.context.class.to_s)} AND migration_id IN (#{migration_ids.map{|id| conn.quote(id)}.join(',')})")
|
||||
conn.execute("UPDATE #{Assignment.quoted_table_name} SET position=CASE #{cases.join(' ')} ELSE NULL END WHERE context_id=#{migration.context.id} AND context_type=#{conn.quote(migration.context.class.to_s)} AND migration_id IN (#{migration_ids.map{|id| conn.quote(id)}.join(',')})")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue