Heroku - PGError:错误:“ENGINE”处或附近的语法错误

发布于 2024-11-28 04:00:04 字数 1035 浏览 0 评论 0原文

我正在尝试

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

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, "name" character varying(255) NOT NULL, "title" character varying(255) NOT NULL, "created_at" timestamp, "updated_at" timestamp) ENGINE=MyISAM

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

内心旳酸楚 2024-12-05 04:00:04

Heroku 使用 PostgreSQL,而 MyISAM 引擎是 MySQL 特定的。我建议你删除那部分。或者,添加对使用的数据库的检查并将其设为可选。

这是如何检查数据库的链接< /a>.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文