您好,我有一个创建表的迁移(并向现有表添加一列)。
class CreateAdminModule < ActiveRecord::Migration
def change
create_table :admin_module do |t|
t.decimal :no_of_devices_multiplier
t.decimal :option_1_multiplier
t.decimal :option_2_multiplier
t.deciaml :option_3_multiplier
t.decimal :option_4_multiplier
t.decimal :option_5_multiplier
t.timestamps
end
end
add_column :admin_user_roles, :module_admin, :boolean
end
我正在使用 mysql2 gem。当我运行迁移时,我得到了这个:
c:\Sites\site>rake db:migrate
-- add_column(:admin_user_roles, :module_admin, :boolean)
-> 0.4726s
== CreateAdminCirrus: migrating ==============================================
-- create_table(:admin_module)
rake aborted!
An error has occurred, all later migrations canceled:
undefined method 'deciaml' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x3c00a80>c:/Sites/site/db/migrate/
20130911082405_create_admin_module.rb:7:in 'block in change'
c:/Sites/site/db/migrate/20130911082405_create_admin_module.rb:3:in 'change'
C:in 'migrate'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
我很困惑为什么我会收到这个错误。我很确定十进制是有效的数据类型?我在处理货币时使用十进制。