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

Migration strategy broken? #304

Closed
marxide opened this issue Sep 1, 2020 · 3 comments · Fixed by #334
Closed

Migration strategy broken? #304

marxide opened this issue Sep 1, 2020 · 3 comments · Fixed by #334

Comments

@marxide
Copy link
Contributor

marxide commented Sep 1, 2020

Following these instructions did not work for me:

https://github.com/askap-vast/vast-pipeline/blob/master/DEVELOPING.md#1-you-modify-modelspy

I modified the models and deleted the 0001_initial migration file. Running makemigrations then fails because the 0002_q3c migration explicitly depends on 0001_initial which now no longer exists.

Does this work for anyone else?

@ajstewart
Copy link
Contributor

In short, no. Those instructions should say to temporary remove/rename 0002_q3c to avoid this error. At least that's what I do when running makemigrations.

@srggrs
Copy link
Contributor

srggrs commented Sep 2, 2020

Sorry, you guys are right. I think those were written when we still set up Q3C manually. I need to finish up those instructions.

The general rule of thumbs is: if you don't have a production site constantly used by users, you can safely remove all the migrations files, then run makemigrations and then get back 0002_q3c file by discarding the changing (deletion) of that file with git checkout path/to/file. If you have a production set up then you don't remove the existing migration files, and use makemigrations to make new files.

@marxide
Copy link
Contributor Author

marxide commented Sep 2, 2020

Now that we do have something deployed, should we change the instructions to simply running makemigrations? We can always squash them later.

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

Successfully merging a pull request may close this issue.

3 participants