This project is archived and is in readonly mode.
rake db:test:clone_structure might fail with multiple schemas in postgres.
-
Juan Manuel Cuello
It is easy to reproduce the problem. These are the steps:
Create a Rails application that uses postgresql:
$ rails new postgres_clone -d postgresql $ cd postgres_cloneThen create a migration:
#db/migrate/20110421194621_my_migration.rb class MyMigration < ActiveRecord::Migration def self.up connection.execute 'CREATE SCHEMA z_schema;' connection.execute 'CREATE TABLE z_schema.table1 (id integer, name varchar[255]);' connection.execute 'CREATE UNIQUE INDEX unique_table1_name ON z_schema.table1 USING btree (name);' end endAnd the run:
$ rake db:create $ rake db:migrate $ rake db:test:clone_structure(in /home/juan/projects/postgres_clone) psql:/home/juan/projects/postgres_clone/db/development_structure.sql:75: ERROR: relation "schema_migrations" does not exist LÍNEA 1: INSERT INTO schema_migrations (version) VALUES ('20110421194... ^ -
Juan Manuel Cuello
The first patch I attached does not apply anymore because 'databases.rake' changed.
This is the same patch but created recently from 'master'.
