Project

General

Profile

Actions

Defect #3420

closed

Default rake task can destroy data

Added by mathew murphy over 15 years ago. Updated almost 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Start date:
2009-05-26
Due date:
% Done:

0%

Estimated time:
Resolution:
Wont fix
Affected version:

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...

Actions #1

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.

Actions #2

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.

Actions #3

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
Actions

Also available in: Atom PDF