Draft
Conversation
This is a WIP as tests are failing when core models reference users models. This seems to be because migrations are run before the conftest hook but we should investigate. For the moment, here is a good strategy for the future: - Run `django-admin inspectdb tablename` and compare the output with the existing model. Make sure it matches. - Make the model managed and run `django-admin makemigrations`. - In production environment, the migration will fail when trying to create alrady existing tables. Connect and run migrations as faked. `django-admin migrate --fake app migrationumber` That way, we will smoothly manage tables and hopefully get rid of the conftest hack. PS: No need remove the model from the conftest as it targets only unmanaged ones.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This is a WIP as tests are failing when core models reference users
models.
This seems to be because migrations are run before the
conftest hook but we should investigate.
For the moment, here is a good strategy for the future:
django-admin inspectdb tablenameand compare the output with theexisting model. Make sure it matches.
django-admin makemigrations.create alrady existing tables. Connect and run migrations as faked.
django-admin migrate --fake app migrationumberThat way, we will smoothly manage tables and hopefully get rid of the
conftest hack.
PS: No need remove the model from the conftest as it targets only unmanaged
ones.
Notes