1- # Generated by Django 5.1.6 on 2025-05-15 10:29
1+ # Generated by Django 5.2.5 on 2025-09-10 17:23
22
3- import apps .common .models
4- import apps .contributor .models
53import django .db .models .manager
64import django_choices_field .fields
5+ import ulid
6+ import utils .common
7+ import uuid
78from django .db import migrations , models
89
910
@@ -15,28 +16,64 @@ class Migration(migrations.Migration):
1516 ]
1617
1718 operations = [
19+ migrations .CreateModel (
20+ name = 'ContributorTeam' ,
21+ fields = [
22+ ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
23+ ('client_id' , models .CharField (max_length = 26 , unique = True , validators = [utils .common .validate_ulid ])),
24+ ('created_at' , models .DateTimeField (auto_now_add = True )),
25+ ('modified_at' , models .DateTimeField (auto_now = True )),
26+ ('is_archived' , models .BooleanField (default = False )),
27+ ('archived_at' , models .DateTimeField (blank = True , null = True )),
28+ ('old_id' , models .CharField (blank = True , db_index = True , max_length = 30 , null = True )),
29+ ('firebase_id' , models .CharField (default = ulid .ULID , max_length = 30 , unique = True )),
30+ ('firebase_push_status' , django_choices_field .fields .IntegerChoicesField (blank = True , choices = [(1 , 'Pending' ), (2 , 'Processing' ), (3 , 'Success' ), (4 , 'Failed' )], null = True )),
31+ ('firebase_last_pushed' , models .DateTimeField (blank = True , help_text = 'The latest time when resource was pushed to firebase' , null = True )),
32+ ('name' , models .CharField (max_length = 255 )),
33+ ('token' , models .UUIDField (default = uuid .uuid4 , unique = True )),
34+ ],
35+ options = {
36+ 'ordering' : ['-id' ],
37+ 'abstract' : False ,
38+ },
39+ managers = [
40+ ('cte_objects' , django .db .models .manager .Manager ()),
41+ ],
42+ ),
1843 migrations .CreateModel (
1944 name = 'ContributorUser' ,
2045 fields = [
2146 ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
22- ('user_id' , models .CharField (db_index = True , help_text = 'Firebase User ID' , max_length = 30 , unique = True )),
47+ ('old_id' , models .CharField (blank = True , db_index = True , max_length = 30 , null = True )),
48+ ('firebase_push_status' , django_choices_field .fields .IntegerChoicesField (blank = True , choices = [(1 , 'Pending' ), (2 , 'Processing' ), (3 , 'Success' ), (4 , 'Failed' )], null = True )),
49+ ('firebase_last_pushed' , models .DateTimeField (blank = True , help_text = 'The latest time when resource was pushed to firebase' , null = True )),
2350 ('username' , models .CharField (max_length = 255 )),
51+ ('firebase_id' , models .CharField (help_text = 'Firebase User ID (External)' , max_length = 30 , unique = True )),
2452 ('created_at' , models .DateTimeField (null = True )),
2553 ('modified_at' , models .DateTimeField (null = True )),
2654 ],
55+ options = {
56+ 'abstract' : False ,
57+ },
58+ managers = [
59+ ('cte_objects' , django .db .models .manager .Manager ()),
60+ ],
2761 ),
2862 migrations .CreateModel (
2963 name = 'ContributorUserGroup' ,
3064 fields = [
3165 ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
32- ('client_id' , models .CharField (editable = False , max_length = 26 , unique = True , validators = [apps .common . models .validate_ulid ])),
66+ ('client_id' , models .CharField (max_length = 26 , unique = True , validators = [utils .common .validate_ulid ])),
3367 ('created_at' , models .DateTimeField (auto_now_add = True )),
3468 ('modified_at' , models .DateTimeField (auto_now = True )),
35- ('old_id' , models .CharField (db_index = True , max_length = 30 , null = True )),
36- ('name' , models .CharField (max_length = 255 )),
37- ('description' , models .TextField ()),
3869 ('is_archived' , models .BooleanField (default = False )),
3970 ('archived_at' , models .DateTimeField (blank = True , null = True )),
71+ ('old_id' , models .CharField (blank = True , db_index = True , max_length = 30 , null = True )),
72+ ('firebase_id' , models .CharField (default = ulid .ULID , max_length = 30 , unique = True )),
73+ ('firebase_push_status' , django_choices_field .fields .IntegerChoicesField (blank = True , choices = [(1 , 'Pending' ), (2 , 'Processing' ), (3 , 'Success' ), (4 , 'Failed' )], null = True )),
74+ ('firebase_last_pushed' , models .DateTimeField (blank = True , help_text = 'The latest time when resource was pushed to firebase' , null = True )),
75+ ('name' , models .CharField (max_length = 255 )),
76+ ('description' , models .TextField ()),
4077 ],
4178 options = {
4279 'ordering' : ['-id' ],
@@ -57,8 +94,22 @@ class Migration(migrations.Migration):
5794 name = 'ContributorUserGroupMembershipLog' ,
5895 fields = [
5996 ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
60- ('action' , django_choices_field .fields .IntegerChoicesField (choices = [(1 , 'Join' ), (2 , 'Leave' )], choices_enum = apps .contributor .models .ContributorUserGroupMembershipLogActionEnum )),
97+ ('action' , django_choices_field .fields .IntegerChoicesField (choices = [(1 , 'Join' ), (2 , 'Leave' )])),
98+ ('date' , models .DateTimeField ()),
99+ ],
100+ ),
101+ migrations .CreateModel (
102+ name = 'ContributorUserGroupMembershipLogTemp' ,
103+ fields = [
104+ ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
105+ ('firebase_id' , models .CharField (max_length = 255 )),
106+ ('contributor_user_group_firebase_id' , models .CharField (max_length = 255 )),
107+ ('contributor_user_firebase_id' , models .CharField (max_length = 255 )),
108+ ('action' , django_choices_field .fields .IntegerChoicesField (choices = [(1 , 'Join' ), (2 , 'Leave' )])),
61109 ('date' , models .DateTimeField ()),
110+ ('contributor_user_group_id' , models .BigIntegerField (blank = True , null = True )),
111+ ('contributor_user_id' , models .BigIntegerField (blank = True , null = True )),
112+ ('is_firebase_mapping_valid' , models .BooleanField (blank = True , null = True )),
62113 ],
63114 ),
64115 ]
0 commit comments