Issue #3053
closedpclean does not remove migrations in the pulp_app or plugin projects
Description
pclean leaves behind migrations and then migrates the database. As a result the database can end up in a strange state after running pclean.
Updated by bmbouter about 7 years ago
I ran into this and I had to manually delete the migrations directories before running pclean.
Updated by amacdona@redhat.com about 7 years ago
pclean doesn't makemigrations, that is done by Ansible at install time[0], and I'd like to keep pclean out of the business of generating migrations.
My thinking is that migrations are generated, but they are still code, and the developers should be aware of them. Later, when we have committed the migrations, developers will be expected to commit new migrations alongside their changes to the data layer, so I think it would be good to get into the habit of making new migrations when you change the data layer.
I wouldn't mind a new dev alias to remove and recreate migrations, though it might get tricky if we want to include plugin migrations.
[0]: https://github.com/pulp/devel/pull/91/files#diff-c674e6be1d4fd8bed7f77bad58146d18R106
Updated by daviddavis about 7 years ago
I concur with @asmacdona. I don't think we should update our aliases since we should be checking in migrations soon for the next major release of Pulp.
Updated by amacdona@redhat.com about 7 years ago
- Status changed from NEW to CLOSED - WONTFIX
Closing as WONTFIX since this is a temporary problem until we commit the migrations.
The problem occurs because migrations from other branches are not removed (because they aren't tracked in git).
Workaround is to remove and remake the migrations.
rm -rf ~/3dev/pulp/platform/pulpcore/app/migrations
You may also need to remove and remake the migrations for the plugins:
rm -rf ~/3dev/pulp_file/pulp_file/app/migrations/
After migrations are removed, remake them all before you try to migrate:
pulp-manager makemigrations pulp_app
pulp-manager makemigrations pulp_<each_plugin>
pclean