Rails has a feature whereby the foo_test database is dropped and then re-created based on the current foo schema, prior to running tests. This allows for things like integration tests that hit the database, and helps keep test runs from interfering with each other by leaving behind crud. Rather than running individual migrations, I believe Rails just copies the schema from foo.
Is there a way to do this (or something close to it) with migrate? Not sure how feasible it is to implement this programmatically in a cross-db fashion, but it sure would be nice to have.
For the moment, I just use the following command line with postgres:
Rails has a feature whereby the
foo_test
database is dropped and then re-created based on the currentfoo
schema, prior to running tests. This allows for things like integration tests that hit the database, and helps keep test runs from interfering with each other by leaving behind crud. Rather than running individual migrations, I believe Rails just copies the schema fromfoo
.Is there a way to do this (or something close to it) with migrate? Not sure how feasible it is to implement this programmatically in a cross-db fashion, but it sure would be nice to have.
For the moment, I just use the following command line with postgres:
I'd love to know how other people are currently solving this problem. Thanks.