# Mbleigh / acts-as-taggable-on migration error for MySQL

**URL:** <https://www.ruby-forum.com/t/mbleigh-acts-as-taggable-on-migration-error-for-mysql/174521>\
**Category:** Rails\
**Created:** [August 28, 2009, 1:16am UTC](https://www.ruby-forum.com/t/mbleigh-acts-as-taggable-on-migration-error-for-mysql/174521 "2009-08-28T01:16:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavan\_Kulkarni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/65b543/32.png) [@Pavan\_Kulkarni](https://www.ruby-forum.com/u/Pavan_Kulkarni)\
**Post date:** [August 28, 2009, 1:16am UTC](https://www.ruby-forum.com/t/mbleigh-acts-as-taggable-on-migration-error-for-mysql/174521/1 "2009-08-28T01:16:36Z")

</div>

Hi,  
I installed acts-as-taggable-on plugin and generated  
acts\_as\_taggable\_on\_migration (Mac OS X, Rails 2.3.3, MySQL).

The migration generated has  
t.column :taggable\_id, :integer  
t.column :tagger\_id, :integer

MySQL complains when rails tries create  
FOREIGN KEY (taggable\_id) REFERENCES taggables (id) and FOREIGN KEY  
(tagger\_id) REFERENCES taggers (id).

Mysql::Error: Can’t create table ‘fastpencil\_development.taggings’  
(errno:  
150): CREATE TABLE `taggings` (`id` int(11) DEFAULT NULL auto\_increment  
PRIMARY KEY, `tag_id` int(11), `taggable_id` int(11), `tagger_id`  
int(11),  
`tagger_type` varchar(255), `taggable_type` varchar(255), `context`  
varchar(255), `created_at` datetime, FOREIGN KEY (tag\_id) REFERENCES  
tags  
(id), FOREIGN KEY (taggable\_id) REFERENCES taggables (id), FOREIGN KEY  
(tagger\_id) REFERENCES taggers (id)) ENGINE=InnoDB

Adding :references =\> nil should fix this, but is that the solution? Has  
anyone see this error before?

Thanks in advance.  
-Pavan
