mysql - Error on rename of a column during a migration in rails -


i trying run migration in rails change name of column getting error:

mysql::error: error on rename of './databasename/#sql-478_17b' './databasename/zz_portal_users' (errno: 150): alter table `zz_portal_users` change `user_id` `zz_user_id` int(11) default null 

here migration trying run:

class renameusersidtozzusersidinzzportalusers < activerecord::migration   def self.up     rename_column :zz_portal_users, :user_id, :zz_user_id   end    def self.down     rename_column :zz_portal_users, :zz_user_id, :user_id   end end 

any idea come from?

thanks!

changing id columns in mysql bit tricky fk must have same data type. can check fks have id int(11).

if doesn't help, please paste ddl of users , related tables.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -