Defect #3420
closedDefault rake task can destroy data
0%
Description
I performed a RedMine update via SVN, but I couldn't remember the rake task name for the database updates. I ran rake with no arguments, hoping for some helpful text.
Instead, rake blew away my production database in order to perform some unit tests.
Needless to say, I think this is less than optimal behavior. It's a good job I had a backup, or I'd probably be badmouthing RedMine all over the Internet at this point...
Updated by Jean-Philippe Lang over 15 years ago
Tests will clear the test database, not your production database, unless you have configured the same database for tests and production in your database.yml file.
Updated by mathew murphy over 15 years ago
True, but it's probably not unusual for people to set up a database, run the tests, then start using the system with the same database rather than deleting it and creating a whole new one.
So I still think it's unwise and unexpected for the default rake task to modify data.
My expectation is that you would run tests by doing 'rake test', and that 'rake' on its own would provide information about what targets/tasks are available... especially since 'rake help' doesn't provide anything helpful.
Updated by Jean-Philippe Lang almost 15 years ago
- Status changed from New to Closed
- Resolution set to Wont fix
This is the Rails behaviour. The default rake task is test.
To get a list of available tasks, use:
rake --tasks