2012-08-26 84 views
0

我跑耙分贝:迁移我的轨道失败并出现以下错误:耙分贝:迁移失败,Mysql2 ::错误:行大小太大

== AddColumnsToSavedSearch: migrating ======================================== 
-- add_column(:saved_searches, :search_param1, :string, {:limit=>1000}) 
    -> 0.0574s 
-- add_column(:saved_searches, :search_param2, :string, {:limit=>1000}) 
rake aborted! 
An error has occurred, all later migrations canceled: 

Mysql2::Error: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs: ALTER TABLE `saved_searches` ADD `search_param2` varchar(1000) 

这种迁移运行在我的其他罚款系统具有相同的配置(相同的OS和DB)。

我的MySQL数据库版本是服务器版本:5.5.24-0ubuntu0.12.04.1(Ubuntu)。

任何帮助表示赞赏。

如果您需要任何信息,请让我知道。

感谢

+0

运行迁移之前,该表的行大小(以字节为单位)是多少? – Zabba

回答

1

这可能不是问题,但一般用于小批量的文本字符串数据类型。我相信它使用MySQL的VARCHAR(255)类型。尝试将数据类型更改为文本。尝试将列限制为大于字符串可支持的大小时可能会有一些冲突。

+0

我很确定这就是问题所在。 ;) –

+0

谢谢。我更改了迁移文件并删除了限制,这一次迁移已经完成。感谢你的帮助。 –

+0

没问题,很高兴我能帮到你。 – anxiety