Commits

Sean Davis committed 480c01f

Added column name quoting in check constraint

Comments (0)

Files changed (1)

lib/mysql2psql/postgres_writer.rb

         default = default + "::character varying" if default
         enum = column[:type].gsub(/enum|\(|\)/, '')
         max_enum_size = enum.split(',').map{ |check| check.size() -2}.sort[-1]
-        "character varying(#{max_enum_size}) check( #{column[:name]} in (#{enum}))"
+        "character varying(#{max_enum_size}) check( \"#{column[:name]}\" in (#{enum}))"
       else
         puts "Unknown #{column.inspect}"
         column[:type].inspect