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

add automatic generation of server_defaults for improving migrations #306

Merged
merged 4 commits into from
Mar 18, 2025

Conversation

devkral
Copy link
Contributor

@devkral devkral commented Mar 15, 2025

Changes:

  • Convert for most fields defaults to server_default to ease migrations. There are some exceptions.
  • Add the setting allow_auto_compute_server_defaults which allows to disable the automatic generation of server defaults.
  • get_default_value is now also overwritable by factories.
  • JSONField default is deepcopied to prevent accidental modifications of the default. There is no need anymore to provide a lambda.

@tarsil
Copy link
Collaborator

tarsil commented Mar 15, 2025

@devkral not passing. Also, let's be careful. I needed to release the 0.28.2 because I needed to redeploy docs and the notes pointed to 0.28.2

@devkral devkral force-pushed the devkral/feature/auto_compute_server_defaults branch from ee713b4 to 027e7f8 Compare March 16, 2025 06:01
@devkral
Copy link
Contributor Author

devkral commented Mar 16, 2025

sry, didn't knew about the release.

Changes:

- Convert for most fields defaults to server_default to ease migrations. There are some exceptions.
- Add the setting `allow_auto_compute_server_defaults` which allows to disable the automatic generation of server defaults.
- `get_default_value` is now also overwritable by factories.
- JSONField `default` is deepcopied to prevent accidental modifications of the default.
  There is no need anymore to provide a lambda.
@devkral devkral force-pushed the devkral/feature/auto_compute_server_defaults branch from 027e7f8 to 907b062 Compare March 16, 2025 06:07
tarsil
tarsil previously approved these changes Mar 17, 2025
@tarsil tarsil dismissed their stale review March 17, 2025 05:47

CI failing

@devkral devkral merged commit f0eb9aa into main Mar 18, 2025
10 checks passed
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 this pull request may close these issues.

2 participants