-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Use django-safemigrate for migrations #11087
Conversation
pre-commit fails because we are installing the requirements from main, not from the current file https://github.com/readthedocs/common/blob/e598102991c5a927024f06f187f51f7000e67023/pre-commit-config.yaml#L98-L101 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I only have some questions about where these migrations need to be called and why there are some data migrations missing.
readthedocs/integrations/migrations/0013_set_timestamp_fields_as_no_null.py
Show resolved
Hide resolved
- #. After the deploy has been completed, create a new migration to set the field as non-nullable (let's call this migration ``app 0003``). | ||
Run this migration on a new deploy, you can mark it as ``Safe.before_deploy`` or ``Safe.always``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this migration be created in the same deploy and marked as after_deploy
to make everything in the same deploy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if that will work, but we still need to another deploy to remove all handling of the null case in the code.
at https://github.com/readthedocs/readthedocs.org/commit/d72ee6e27dc398b97e884ccec8a8cf135134faac. | ||
""" | ||
Version = apps.get_model("builds", "Version") | ||
date = datetime.datetime(2020, 11, 23, tzinfo=datetime.timezone.utc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use a date that it's obvious it's wrong to avoid confusions here? Like 1999-01-01
or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would add more confusion, for us and users (if we expose this field).
Closes #10964
📚 Documentation previews 📚
docs
): https://docs--11087.org.readthedocs.build/en/11087/dev
): https://dev--11087.org.readthedocs.build/en/11087/