当我在Heroku上加载我的Rails 5.1应用程序中的模式时,会引发以下异常:
ActiveRecord :: StatementInvalid:PG :: SyntaxError:ERROR:在或附近的语法错误“ ENGINE” 第1行:... estamp NOT NULL,“updated_at”时间戳NOT NULL)ENGINE=Inn ...
细节: 跟踪
ActiveRecord :: StatementInvalid:PG :: SyntaxError:ERROR:在或附近的语法错误“ ENGINE” 第1行:... estamp NOT NULL,“updated_at”时间戳NOT NULL)ENGINE=Inn ...
细节: 跟踪
-- create_table("ads_dashboard_campaigns", {:force=>:cascade, :options=>"ENGINE=InnoDB DEFAULT CHARSET=utf8"})
(5.0ms) DROP TABLE IF EXISTS "ads_dashboard_campaigns" CASCADE
(7.3ms) CREATE TABLE "ads_dashboard_campaigns" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
rails aborted!
config/database.yml
# # SQLite version 3.x
# # gem install sqlite3-ruby (not necessary on OS X Leopard)
# development:
# adapter: sqlite3
# database: db/development.sqlite3
# pool: 5
# timeout: 5000
# # Warning: The database defined as "test" will be erased and
# # re-generated from your development database when you run "rake".
# # Do not set this db to the same as development or production.
# test:
# adapter: sqlite3
# database: db/test.sqlite3
# pool: 5
# timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
# Custom stuff
development:
adapter: mysql2
encoding: utf8
pool: 5
database: slooob_development
username: root
password: 0402Jonas
port: 3306
test:
adapter: mysql2
encoding: utf8
pool: 5
database: slooob_test
username: root
password: 0402Jonas
port: 3306
附言:我知道Heroku使用的是PostgreSQL数据库,但是在将开发和测试数据库设置为MySQL之前,使用默认生产设置已经成功过。我也尝试将适配器设置为postgresql
。
我的哪里做错了吗?