-
Notifications
You must be signed in to change notification settings - Fork 195
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
db:migrate:with_data not picking up schema changes #158
Comments
I've faced same issue, and this seems to be caused by below part. https://github.com/ilyakatz/data-migrate/blob/master/tasks/databases.rake#L33-L38 As far as I can see, |
@saiidalhalawi I don't think this is the issue, if there are pending |
@jasonivers this scenario is described in Rails 4.0 docs and for what I understand is an expected behaviour:
|
Is this related to #201 by chance? Currently both |
splitting the schema and data migration commands fixes the issue. run |
I have two migrations, one a schema update to add a column to a table, the other a data migration to set the right data for existing records for that field. The schema migration has an id/timestamp/whatever of 20201111204508, and the data migration has an id of 20201111204520. The schema migration logs out to the screen first (as it should), but the data migration fails because it doesn't see the new column in the table (or attribute on the model). If I then, after all migrations finish, just run rails data:migrate, the same migration runs just fine.
Do I need to call reset_column_information on the model in the data migration before updating the new field, or is it something else?
The text was updated successfully, but these errors were encountered: