Skip to content

Commit 3b50a66

Browse files
committed
feat(remove-from-team): include is_active in unique constraint to prevent sync failures
1 parent 42c9485 commit 3b50a66

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Generated by Django 5.1.5 on 2025-09-05 15:27
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("todo", "0003_postgresauditlog_task_count"),
9+
]
10+
11+
operations = [
12+
migrations.AlterUniqueTogether(
13+
name="postgresuserrole",
14+
unique_together={("user_id", "role_name", "scope", "team_id", "is_active")},
15+
),
16+
]

todo/models/postgres/user_role.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PostgresUserRole(models.Model):
2727

2828
class Meta:
2929
db_table = "postgres_user_roles"
30-
unique_together = ["user_id", "role_name", "scope", "team_id"]
30+
unique_together = ["user_id", "role_name", "scope", "team_id", "is_active"]
3131
indexes = [
3232
models.Index(fields=["mongo_id"]),
3333
models.Index(fields=["user_id"]),

0 commit comments

Comments
 (0)