Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations dont have a zero version - cant roll all the way back #292

Closed
jeremyevans opened this issue May 1, 2011 · 2 comments
Closed
Assignees

Comments

@jeremyevans
Copy link
Owner

What steps will reproduce the problem?

  1. Create a migration numbered 1 (or more)
  2. Use the bin/sequel command with "-m dir" to migrate forward
  3. Try to use the bin/sequel command with "-m dir -M 0" to get an empty database ...
  4. nothing happens

What is the expected output? What do you see instead?
Expecting the database tables be dropped, like the migration file says in "def down"

What version of the product are you using? On what operating system?
tag 3.0.0 - commit 10f69a2
mac os x 10.5.7

Please provide any additional information below.
when i was using rails and activerecord, migrating down to zero was a great way to know that all
the migrations are okay both upward and downward - and did not require additional commands
to drop and re-create databases.

Google Code Info:
Issue #: 268
Author: evgeny.zislis
Created On: 2009-06-02T22:48:30.000Z
Closed On: 2009-06-02T23:03:56.000Z

@ghost ghost assigned jeremyevans May 1, 2011
@jeremyevans
Copy link
Owner Author

hmm, it didn't work when i had more than one create_table in the 001 migration and it failed in the middle ...
but generally it does work, so sorry - my bad.

maybe each migration should be inside a transaction?

(using mysql)

Google Code Info:
Author: evgeny.zislis
Created On: 2009-06-02T22:59:23.000Z

@jeremyevans
Copy link
Owner Author

MySQL doesn't allow transactional schema changes, and I think other databases might
have problems with them too. You can always use Database#transaction manually in a
migration if you want a certain part to be transactional.

Google Code Info:
Author: jeremyev...@gmail.com
Created On: 2009-06-02T23:03:56.000Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant