Skip to content

Commit

Permalink
Modify constraint syntax in existing migration
Browse files Browse the repository at this point in the history
  • Loading branch information
gherceg committed Nov 28, 2023
1 parent 837cccb commit 0bb2fc9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions field_audit/migrations/0002_add_is_bootstrap_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@ class Migration(migrations.Migration):
model_name='auditevent',
constraint=models.CheckConstraint(
name='field_audit_auditevent_chk_create_or_delete_or_bootstrap',
check=models.Q(
models.Q(
models.Q(('is_create', True), ('is_delete', True)),
models.Q(('is_bootstrap', True), ('is_create', True)),
models.Q(('is_bootstrap', True), ('is_delete', True)),
_connector='OR',
),
_negated=True,
check=~(
models.Q(is_create=True, is_delete=True) | \
models.Q(is_create=True, is_bootstrap=True) | \
models.Q(is_delete=True, is_bootstrap=True) # noqa: E502
),
),
),
Expand Down

0 comments on commit 0bb2fc9

Please sign in to comment.