hi there. Has anyone ever have this happen to them where they did one of these raw ''execute fk_'' sql commands in their migrations (like seen in the depot app in the agile rails book when they were building the line item active record...anyways, now i can''t get those foreign keys to delete, nor can i even get the column_id to delete too..so weird.. humm..just ''checked'' the table in phpmyadmin, reset the server, reset mysql, dropping that coloumn_id still doesn''t work.. this is the error i get: Mysql::Error: #HY000Error on rename of ''.\app_development\#sql-644_5'' to ''.\app_development\users'' (errno: 150): ALTER TABLE users DROP `column_id` thanks Dominic -- Posted via http://www.ruby-forum.com/.
Dominic Son
2006-Jul-31 22:57 UTC
[Rails] solved: Re: Problem with dropping the column_id column...
I had to do a sql operation first: ALTER TABLE table_name DROP FOREIGN KEY fk_ Dominic Son wrote:> hi there. > > Has anyone ever have this happen to them where they did one of these raw > ''execute fk_'' sql commands in their migrations (like seen in the depot > app in the agile rails book when they were building the line item active > record...anyways, now i can''t get those foreign keys to delete, nor can > i even get the column_id to delete too..so weird.. > > humm..just ''checked'' the table in phpmyadmin, reset the server, reset > mysql, dropping that coloumn_id still doesn''t work.. > > this is the error i get: Mysql::Error: #HY000Error on rename of > ''.\app_development\#sql-644_5'' to ''.\app_development\users'' (errno: > 150): ALTER TABLE users DROP `column_id` > > thanks > > Dominic-- Posted via http://www.ruby-forum.com/.
On 7/31/06, Dominic Son <dominicson@gmail.com> wrote:> hi there. > > Has anyone ever have this happen to them where they did one of these raw > ''execute fk_'' sql commands in their migrations (like seen in the depot > app in the agile rails book when they were building the line item active > record...anyways, now i can''t get those foreign keys to delete, nor can > i even get the column_id to delete too..so weird.. > > humm..just ''checked'' the table in phpmyadmin, reset the server, reset > mysql, dropping that coloumn_id still doesn''t work.. > > this is the error i get: Mysql::Error: #HY000Error on rename of > ''.\app_development\#sql-644_5'' to ''.\app_development\users'' (errno: > 150): ALTER TABLE users DROP `column_id`When using foreign keys with mysql both tables have to be innodb, the foreign key has to have an index, and both keys need to be of the same type.
Apparently Analagous Threads
- Parsing a SQL file directly into activerecord::execute method
- Parsing a SQL file directly into activerecord::executemethod - Not a vamp I swear
- Rails on Snow Leopard
- Parsing a SQL file directly intoactiverecord::executemethod - Not a vamp I swear
- Rails DB defaults to utf8 for mysql -- but unicode for postgresql