开发者

Heroku - PGError: ERROR: syntax error at or near "ENGINE"

开发者 https://www.devze.com 2023-03-26 14:29 出处:网络
I am trying to run heroku rake db:migrate to run my migrations on heroku and the first two migrations ran great but the third which looks like this

I am trying to run

heroku rake db:migrate

to run my migrations on heroku and the first two migrations ran great but the third which looks like this

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, "n开发者_运维问答ame" character varying(255) NOT NULL, "title" character varying(255) NOT NULL, "created_at" timestamp, "updated_at" timestamp) ENGINE=MyISAM


Heroku uses PostgreSQL, and MyISAM engine is MySQL-specific. I suggest you remove that part. Or, add checking on what database is used and make that optional.

Here's a link to how to check the database.

0

精彩评论

暂无评论...
验证码 换一张
取 消