Skip to content

Enforce resolved database options and remove implicit slug indexes - #11

Merged
script3r merged 1 commit into
codex/fix-binary-adaptationfrom
codex/validate-resolved-field-options
Sep 5, 2026
Merged

Enforce resolved database options and remove implicit slug indexes#11
script3r merged 1 commit into
codex/fix-binary-adaptationfrom
codex/validate-resolved-field-options

Conversation

@script3r

@script3r script3r commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Database-option checks only inspected keyword arguments. Positional primary_key, unique, db_index, and db_default arguments bypassed the restrictions, and EncryptedSlugField() silently inherited Django's db_index=True default.

Validate options after Django resolves arguments and defaults, and default randomized slug fields to db_index=False. Supported deterministic indexes and uniqueness remain available, including positional arguments.

Applications using encrypted slug fields should run makemigrations and apply the generated index-removal migration. Existing ciphertext is unchanged. Previously accepted positional configurations that violate the documented restrictions now fail during field construction.

Validation: 6 initial regression cases failed before the fix; additional cases cover positional database defaults. All 130 library tests pass on Python 3.14 / Django 6.0, with the new constructor suite also passing on Python 3.10 / Django 5.2 / Tink 1.13.0. The 6 example tests pass. Tests inspect real database indexes and migration deconstruction/clone behavior. Ruff lint/format and Pyright pass.

Stack position: 5 of 6; depends on #10. Land predecessors first and retarget to main as needed.

Landing order: #7#8#9#10#11#12.

Full review and landing notes. Use merge commits to preserve stack ancestry; squash/rebase merges require rebasing the remaining stack before landing it.

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.

1 participant