我用默认的 sqllite 制作了一个 rails 4 应用程序。但是在 heroku 上,当我运行我的第一次迁移时,我遇到了错误,同时一切都在本地完美运行:
$ heroku run rake db:migrate
错误:
Running `rake db:migrate` attached to terminal... up, run.3709
Migrating to AddIndexToUserName (20131003064019)
== AddIndexToUserName: migrating =============================================
-- add_index(:users, :name, {:unique=>true})
PG::UndefinedColumn: ERROR: column "name" does not exist
: CREATE UNIQUE INDEX "index_users_on_name" ON "users" ("name")
rake aborted!
An error has occurred, this and all later migrations canceled:
PG::UndefinedColumn: ERROR: column "name" does not exist
: CREATE UNIQUE INDEX "index_users_on_name" ON "users" ("name")/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `exec'
/
这是我的 database.yml
development:
adapter: postgresql
encoding: unicode
database: poets_app_development
pool: 5
username: alain
password: some_password