Project

Profile

Help

Issue #3053

pclean does not remove migrations in the pulp_app or plugin projects

Added by dkliban@redhat.com about 2 years ago. Updated 6 months ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

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.

History

#1 Updated by bmbouter about 2 years ago

I ran into this and I had to manually delete the migrations directories before running pclean.

#2 Updated by amacdona@redhat.com about 2 years ago

pclean doesn't makemigrations, that is done by Ansible at install time0, 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

#3 Updated by daviddavis about 2 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.

#4 Updated by amacdona@redhat.com about 2 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

#5 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#6 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF