GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6520
Created by Jigar Patel - 2011-03-04 12:40:13 UTC
I have been researching on using multiple Postgres schemas in a single rails app. One option is to develop the entire app in one schema (default schema) and then create other shemas and dump the database structure in them. Other option is to support running migrations in specified schema and maintain the schema_migrations table in each schema.
I have made some patches, but I am not sure of the correctness of the approach. Here is what I have done -
This would result in this flow -
rake db:migrate SCHEMA=demo
Rake tasks will have following steps -
a) Set current schema search path
b) Run the migration (as it is done now)
c) Set schema_search_path to old schema search path.
Now a developer can develop in a "dev" schema, and run the migration in any specified schema or all the schemas.
Can somebody guide me, so that I can write test cases for this?
Don't rewrap system level exceptions with StatementInvalid
Signed-off-by: Michael Koziarski <firstname.lastname@example.org>
??? it's bug or normal?