1- # Generated by Django 5.1.3 on 2024-11-20 09:04
1+ # Generated by Django 5.1.3 on 2025-01-14 13:01
22
3+ import django .core .validators
34import django .db .models .deletion
45from django .conf import settings
56from django .db import migrations , models
@@ -14,25 +15,85 @@ class Migration(migrations.Migration):
1415 ]
1516
1617 operations = [
18+ migrations .CreateModel (
19+ name = 'CulturalHeritage' ,
20+ fields = [
21+ ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
22+ ('heritage_type' , models .CharField (choices = [('tangible' , 'Tangible Heritage' ), ('intangible' , 'Intangible Heritage' ), ('natural' , 'Natural Heritage' )], max_length = 50 )),
23+ ('title' , models .CharField (max_length = 255 )),
24+ ('description' , models .TextField ()),
25+ ('location' , models .CharField (max_length = 255 )),
26+ ('historical_context' , models .TextField ()),
27+ ('created_at' , models .DateTimeField (auto_now_add = True )),
28+ ],
29+ ),
30+ migrations .CreateModel (
31+ name = 'ActivityLog' ,
32+ fields = [
33+ ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
34+ ('action' , models .CharField (choices = [('add' , 'Added' ), ('edit' , 'Edited' ), ('delete' , 'Deleted' ), ('review' , 'Reviewed' ), ('comment' , 'Commented' )], max_length = 50 )),
35+ ('description' , models .TextField ()),
36+ ('timestamp' , models .DateTimeField (auto_now_add = True )),
37+ ('user' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , related_name = 'activity_logs' , to = settings .AUTH_USER_MODEL )),
38+ ],
39+ ),
40+ migrations .CreateModel (
41+ name = 'Contributor' ,
42+ fields = [
43+ ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
44+ ('relationship_to_heritage' , models .TextField ()),
45+ ('consent_to_share' , models .BooleanField (default = False )),
46+ ('user' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , related_name = 'contributions' , to = settings .AUTH_USER_MODEL )),
47+ ],
48+ ),
1749 migrations .CreateModel (
1850 name = 'Submission' ,
1951 fields = [
2052 ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
2153 ('title' , models .CharField (max_length = 255 )),
2254 ('description' , models .TextField ()),
23- ('status' , models .CharField (choices = [('pending' , 'Pending' ), ('review ' , 'Review ' ), ('accepted ' , 'Accepted ' ), ('rejected ' , 'Rejected ' )], default = 'pending' , max_length = 10 )),
55+ ('status' , models .CharField (choices = [('pending' , 'Pending' ), ('accepted ' , 'Accepted ' ), ('rejected ' , 'Rejected ' ), ('review ' , 'Review ' )], default = 'pending' , max_length = 10 )),
2456 ('created_at' , models .DateTimeField (auto_now_add = True )),
57+ ('contribution_type' , models .CharField (choices = [('historical_figure' , 'Historical Figure' ), ('historical_event' , 'Historical Event' ), ('cultural_artifact' , 'Cultural Artifact' ), ('tradition_custom' , 'Tradition/Custom' ), ('other' , 'Other' )], default = 'historical_figure' , max_length = 50 )),
58+ ('contribution_data' , models .JSONField (default = dict )),
2559 ('contributor' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , related_name = 'submissions' , to = settings .AUTH_USER_MODEL )),
60+ ('cultural_heritage' , models .ForeignKey (blank = True , null = True , on_delete = django .db .models .deletion .CASCADE , to = 'heritage_data.culturalheritage' )),
2661 ],
2762 ),
2863 migrations .CreateModel (
2964 name = 'Moderation' ,
3065 fields = [
3166 ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
3267 ('comment' , models .TextField (blank = True )),
33- ('reviewed_at' , models .DateTimeField (auto_now = True )),
68+ ('reviewed_at' , models .DateTimeField (auto_now_add = True )),
3469 ('moderator' , models .ForeignKey (blank = True , null = True , on_delete = django .db .models .deletion .SET_NULL , related_name = 'moderated_items' , to = settings .AUTH_USER_MODEL )),
3570 ('submission' , models .OneToOneField (on_delete = django .db .models .deletion .CASCADE , related_name = 'moderation' , to = 'heritage_data.submission' )),
3671 ],
3772 ),
73+ migrations .CreateModel (
74+ name = 'Media' ,
75+ fields = [
76+ ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
77+ ('media_type' , models .CharField (choices = [('image' , 'Image' ), ('video' , 'Video' ), ('audio' , 'Audio' )], max_length = 50 )),
78+ ('file' , models .FileField (upload_to = 'heritage_media/' )),
79+ ('description' , models .TextField (blank = True )),
80+ ('submission' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , related_name = 'media' , to = 'heritage_data.submission' )),
81+ ],
82+ ),
83+ migrations .CreateModel (
84+ name = 'UserProfile' ,
85+ fields = [
86+ ('id' , models .BigAutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
87+ ('first_name' , models .CharField (blank = True , max_length = 50 )),
88+ ('middle_name' , models .CharField (blank = True , max_length = 50 )),
89+ ('last_name' , models .CharField (blank = True , max_length = 50 )),
90+ ('email' , models .EmailField (blank = True , max_length = 254 )),
91+ ('birth_date' , models .DateField (blank = True , null = True )),
92+ ('organization' , models .CharField (blank = True , max_length = 255 )),
93+ ('position' , models .CharField (blank = True , max_length = 255 )),
94+ ('score' , models .IntegerField (default = 0 , validators = [django .core .validators .MinValueValidator (0 ), django .core .validators .MaxValueValidator (100 )])),
95+ ('university_school' , models .CharField (blank = True , max_length = 255 )),
96+ ('user' , models .OneToOneField (on_delete = django .db .models .deletion .CASCADE , related_name = 'profile' , to = settings .AUTH_USER_MODEL )),
97+ ],
98+ ),
3899 ]
0 commit comments