2011-08-05 60 views
0

我试图运行的Heroku - PGError:错误:在语法错误或接近“引擎”

heroku rake db:migrate 

到在Heroku上运行我的迁移和前两个迁移跑伟大的,但第三个看起来像这样

create_table :charities, :options => "ENGINE=MyISAM" do |t| 
    t.string :name,    :null => false 
    t.string :title,    :null => false 
    t.timestamps 
end 

add_index :charities, :name 
add_index :charities, :title 


Migrating to CreateCharitiesAndThemes (20091019140537) 
== CreateCharitiesAndThemes: migrating ======================================= 
-- create_table(:charities, {:options=>"ENGINE=MyISAM"}) 
rake aborted! 
An error has occurred, this and all later migrations canceled: 

PGError: ERROR: syntax error at or near "ENGINE" 
LINE 1: ..., "created_at" timestamp, "updated_at" timestamp) ENGINE=MyI... 
                  ^
: CREATE TABLE "charities" ("id" serial primary key, "name" character varying(255) NOT NULL, "title" character varying(255) NOT NULL, "created_at" timestamp, "updated_at" timestamp) ENGINE=MyISAM 

回答

9

Heroku使用PostgreSQL,MyISAM引擎是MySQL特有的。我建议你删除那部分。或者,添加检查使用哪个数据库并使其成为可选项。

这是a link to how to check the database

+4

或者更好的是,在您部署到的同一个堆栈上进行开发。 –

相关问题