fix cuser_role model and add unique together
This commit is contained in:
1 parent
4e7fa3d6ef
commit
5052bde49a
5 files changed
+60
-2
No files matched your search
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-23 07:21
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('workspace', '0013_alter_workspace_cuser_owner'),
|
||||
('cuser', '0009_cuserrole_cuser'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterUniqueTogether(
|
||||
name='cuserrole',
|
||||
unique_together={('cuser', 'role_type', 'sys_ws')},
|
||||
),
|
||||
]
|
||||
@@ -30,6 +30,9 @@ class CuserRole(BaseModel):
|
||||
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
|
||||
is_active = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
unique_together = ('cuser', 'role_type', 'sys_ws', )
|
||||
|
||||
def __str__(self):
|
||||
return f'{str(self.cuser) } - { str(self.id) }'
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-23 07:21
|
||||
|
||||
from django.db import migrations, models
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('jwt_auth', '0072_alter_cuserroleloginopt_uuid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='cuserroleloginopt',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.UUID('d65744d0-d235-4b75-a7b1-4349ae36d7d2'), unique=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.1 on 2024-01-23 07:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('reminder', '0022_alter_reminder_type'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='reminder',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('CU', 'CUSTOMER'), ('LE', 'LEAD'), ('UN', 'UNKNOWN'), ('NO', 'NOTE')], default='UN', max_length=2),
|
||||
),
|
||||
]
|
||||
Reference in new issue
Block a user