1
- # Generated by Django 3.2.25 on 2024-07-09 08:56
1
+ # Generated by Django 3.2.25 on 2024-07-09 17:41
2
2
3
+ import datetime
3
4
from django .conf import settings
4
5
from django .db import migrations , models
5
6
import django .db .models .deletion
@@ -14,17 +15,17 @@ class Migration(migrations.Migration):
14
15
15
16
operations = [
16
17
migrations .CreateModel (
17
- name = 'ShiftObserve ' ,
18
+ name = 'ShiftWatch ' ,
18
19
fields = [
19
20
('id' , models .AutoField (auto_created = True , primary_key = True , serialize = False , verbose_name = 'ID' )),
20
- ('notification_timedelta' , models .DurationField ()),
21
+ ('notification_timedelta' , models .DurationField (default = datetime . timedelta ( days = 2 ) )),
21
22
('created_at' , models .DateTimeField (auto_now_add = True )),
22
- ('shift_to_be_notified_about ' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , to = 'shifts.shift' )),
23
- ('user' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , related_name = 'shift_notification_entry ' , to = settings .AUTH_USER_MODEL )),
23
+ ('shift_watched ' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , to = 'shifts.shift' )),
24
+ ('user' , models .ForeignKey (on_delete = django .db .models .deletion .CASCADE , related_name = 'user_watching_shift ' , to = settings .AUTH_USER_MODEL )),
24
25
],
25
26
),
26
27
migrations .AddConstraint (
27
- model_name = 'shiftobserve ' ,
28
- constraint = models .UniqueConstraint (fields = ('user' , 'shift_to_be_notified_about ' ), name = 'user_shift_constraint ' ),
28
+ model_name = 'shiftwatch ' ,
29
+ constraint = models .UniqueConstraint (fields = ('user' , 'shift_watched ' ), name = 'shift_watch_constraint ' ),
29
30
),
30
31
]
0 commit comments