架构迁移的非公共架构

时间:2013-12-22 22:25:43

标签: ruby-on-rails database postgresql rails-activerecord

我的应用程序使用Postgresql的模式而不是多个数据库,因此每个环境都有自己的模式。也就是说,我正在使用一个带有productiondevelopmenttest架构的数据库。我从这个数据库中删除了public模式。

我已经创建了我的第一次迁移,但是当我运行rake db:migrate时,我收到错误消息

PG::InvalidSchemaName: ERROR:  no schema has been selected to create in: CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 

我已将schema_search_path添加到我的database.yml

development:
  adapter: postgresql
  username: 
  password: 
  database: 
  host: localhost
  port: 5433
  schema_search_path: 'development'

由于我的应用程序不会使用任何会使其成为多租户的功能,我真的不想使用像Apartment这样的大型宝石。有没有办法让rake db:migrate命令与我的模式一起工作?

1 个答案:

答案 0 :(得分:0)

因为您的数据库中没有名为development的架构。

相关问题