Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lulalala/migration-bug
Showing a Rails migration bug
https://github.com/lulalala/migration-bug
Last synced: 9 days ago
JSON representation
Showing a Rails migration bug
- Host: GitHub
- URL: https://github.com/lulalala/migration-bug
- Owner: lulalala
- Created: 2012-07-03T06:46:35.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-07-03T06:53:03.000Z (over 12 years ago)
- Last Synced: 2023-03-12T04:48:31.647Z (over 1 year ago)
- Language: Ruby
- Size: 129 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
Awesome Lists containing this project
README
== Migration bug
This is to demonstrate a bug in Rails migration, which causes newly added columns to not update.
== Preparation for database:
1. rake db:migrate
2. rake db:seed
3. rake db:rollback STEP=3
Now we have the item table in an initial state with data.
== Step to produce error
4. rake db:migrate
This would run the 3 migrations which causes the bug.
Now you would see that the mode column is not updatedAs a comparison, do the following:
5. rake db:rollback STEP=3
6. Change just_lookup.rb to be an empty migration OR add Item.reset_column_information at the end of that migration
7. rake db:migrate
You would now see that the mode column is filled with values.
This shows just_lookup.rb should be related to the bug, and reset_column_information is not called for every migrations.