mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Add rm -f db/structure.sql to reset the test database
When `db/structure.sql` exists, it's used when doing `rails db:migrate` instead of running the migrations. When switching to a branch with less migrations, the test database will be created with the `db/structure.sql` file which contains the migrations of the previous branch. They should not be there. To have the correct database structure for tests, the `db/structure.sql` file must be removed before running `db:migrate`.
This commit is contained in:
@@ -672,7 +672,7 @@ class Formatter
|
||||
end
|
||||
|
||||
def reset_test_database_command
|
||||
"bin/rails db:drop db:create db:migrate RAILS_ENV=test"
|
||||
"rm -f db/structure.sql; bin/rails db:drop db:create db:migrate RAILS_ENV=test"
|
||||
end
|
||||
|
||||
def precompile_assets_command
|
||||
|
||||
Reference in New Issue
Block a user