[GH-ISSUE #145] Model changes missing corresponding migrations #99

Closed
opened 2026-02-25 23:41:10 +03:00 by kerem · 4 comments
Owner

Originally created by @iphoting on GitHub (Dec 27, 2017).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/145

I think there might be missing a migration for this change-set cb1eac50d9 (PagerTree) and one other change-set touching accounts, which I couldn't locate?

I'm getting the following notice when I do a pre-deploy executing python manage.py migrate.

$ python manage.py migrate
Operations to perform:
  Apply all migrations: accounts, admin, api, auth, contenttypes, payments, sessions
Running migrations:
  No migrations to apply.
  Your models have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

Running makemigrations got me the following new files:

	hc/accounts/migrations/0014_auto_20171227_1456.py
	hc/api/migrations/0034_auto_20171227_1456.py

Hope this helps!

Originally created by @iphoting on GitHub (Dec 27, 2017). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/145 I think there might be missing a migration for this change-set cb1eac50d98aa161c4ad7f888bd3be44cec030d1 (PagerTree) and one other change-set touching accounts, which I couldn't locate? I'm getting the following notice when I do a pre-deploy executing `python manage.py migrate`. ``` $ python manage.py migrate Operations to perform: Apply all migrations: accounts, admin, api, auth, contenttypes, payments, sessions Running migrations: No migrations to apply. Your models have changes that are not yet reflected in a migration, and so won't be applied. Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them. ``` Running `makemigrations` got me the following new files: ``` hc/accounts/migrations/0014_auto_20171227_1456.py hc/api/migrations/0034_auto_20171227_1456.py ``` Hope this helps!
kerem closed this issue 2026-02-25 23:41:10 +03:00
Author
Owner

@cuu508 commented on GitHub (Dec 27, 2017):

You are right -- thanks!

I think neither of the migrations change anything in the database, but it is good to have them to avoid the above warning and for the completeness sake.

<!-- gh-comment-id:354130858 --> @cuu508 commented on GitHub (Dec 27, 2017): You are right -- thanks! I think neither of the migrations change anything in the database, but it is good to have them to avoid the above warning and for the completeness sake.
Author
Owner

@cuu508 commented on GitHub (Dec 27, 2017):

PS the other changeset is this one: github.com/healthchecks/healthchecks@f611a23f0b

I had added a related_name parameter on Member.user field but had not created a migration for it.

<!-- gh-comment-id:354131081 --> @cuu508 commented on GitHub (Dec 27, 2017): PS the other changeset is this one: https://github.com/healthchecks/healthchecks/commit/f611a23f0bd5d9d83cff349a86313f6d25191bbf I had added a `related_name` parameter on `Member.user` field but had not created a migration for it.
Author
Owner

@iphoting commented on GitHub (Dec 28, 2017):

Thanks for the quick response.
I was wondering, had the migrations not been created and applied to the database, and should a PagerTree integration be added, wouldn't it crash the app?

<!-- gh-comment-id:354240993 --> @iphoting commented on GitHub (Dec 28, 2017): Thanks for the quick response. I was wondering, had the migrations not been created and applied to the database, and should a PagerTree integration be added, wouldn't it crash the app?
Author
Owner

@cuu508 commented on GitHub (Dec 28, 2017):

The live site at https://healthchecks.io has the PagerTree integration, but doesn't have these two migrations applied yet. It seems to be working OK.

If I understand it correctly, neither migration makes any changes to the database (no altered columns, constraints, indexes or anything like that), they just bring the migration history in sync with the model classes defined in models.py. And if the model classes and the database structure match up, it works.

<!-- gh-comment-id:354331362 --> @cuu508 commented on GitHub (Dec 28, 2017): The live site at https://healthchecks.io has the PagerTree integration, but doesn't have these two migrations applied yet. It seems to be working OK. If I understand it correctly, neither migration makes any changes to the database (no altered columns, constraints, indexes or anything like that), they just bring the migration history in sync with the model classes defined in `models.py`. And if the model classes and the database structure match up, it works.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#99
No description provided.