I can't understand what's wrong with my migration syntax, please help. I ran rake db:migrate, database in MySql2
error:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING CAST(number AS integer) DEFAULT NULL' at line 1: ALTER TABLE
seats
CHANGEnumber
number
integer USING CAST(number AS integer) DEFAULT NULL
below it the syntax:
class ChangeNumberTypeInSeats < ActiveRecord::Migration
def change
change_column :seats, :number, 'integer USING CAST(number AS integer)'
end
end
My guess is that because my partner uses PostgreSQL locally, but pushed the code anyway to out Git. Please help.