2022-06-03 08:09:47 -06:00
# Generated by Django 3.2.5 on 2022-05-31 14:46
import apps . schedules . models . custom_on_call_shift
import apps . schedules . models . on_call_schedule
import django . core . validators
from django . db import migrations , models
import django . db . models . deletion
import uuid
2023-02-06 16:01:37 +08:00
import django_migration_linter as linter
2022-06-03 08:09:47 -06:00
class Migration ( migrations . Migration ) :
initial = True
dependencies = [
]
operations = [
2023-02-06 16:01:37 +08:00
linter . IgnoreMigration ( ) ,
2022-06-03 08:09:47 -06:00
migrations . CreateModel (
name = ' CustomOnCallShift ' ,
fields = [
( ' id ' , models . BigAutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' public_primary_key ' , models . CharField ( default = apps . schedules . models . custom_on_call_shift . generate_public_primary_key_for_custom_oncall_shift , max_length = 20 , unique = True , validators = [ django . core . validators . MinLengthValidator ( 13 ) ] ) ) ,
( ' name ' , models . CharField ( max_length = 200 ) ) ,
( ' time_zone ' , models . CharField ( default = None , max_length = 100 , null = True ) ) ,
( ' source ' , models . IntegerField ( choices = [ ( 0 , ' web ' ) , ( 1 , ' api ' ) , ( 2 , ' slack ' ) , ( 3 , ' terraform ' ) ] , default = 1 ) ) ,
( ' rolling_users ' , models . JSONField ( default = None , null = True ) ) ,
( ' start_rotation_from_user_index ' , models . PositiveIntegerField ( default = None , null = True ) ) ,
( ' uuid ' , models . UUIDField ( default = uuid . uuid4 ) ) ,
( ' type ' , models . IntegerField ( choices = [ ( 0 , ' Single event ' ) , ( 1 , ' Recurrent event ' ) , ( 2 , ' Rolling users ' ) ] ) ) ,
( ' start ' , models . DateTimeField ( ) ) ,
( ' duration ' , models . DurationField ( ) ) ,
( ' frequency ' , models . IntegerField ( choices = [ ( 0 , ' Daily ' ) , ( 1 , ' Weekly ' ) , ( 2 , ' Monthly ' ) ] , default = None , null = True ) ) ,
( ' priority_level ' , models . IntegerField ( default = 0 ) ) ,
( ' interval ' , models . IntegerField ( default = None , null = True ) ) ,
( ' week_start ' , models . IntegerField ( choices = [ ( 0 , ' Monday ' ) , ( 1 , ' Tuesday ' ) , ( 2 , ' Wednesday ' ) , ( 3 , ' Thursday ' ) , ( 4 , ' Friday ' ) , ( 5 , ' Saturday ' ) , ( 6 , ' Sunday ' ) ] , default = 6 ) ) ,
( ' by_day ' , models . JSONField ( default = None , null = True ) ) ,
( ' by_month ' , models . JSONField ( default = None , null = True ) ) ,
( ' by_monthday ' , models . JSONField ( default = None , null = True ) ) ,
] ,
) ,
migrations . CreateModel (
name = ' OnCallSchedule ' ,
fields = [
( ' id ' , models . BigAutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' public_primary_key ' , models . CharField ( default = apps . schedules . models . on_call_schedule . generate_public_primary_key_for_oncall_schedule_channel , max_length = 20 , unique = True , validators = [ django . core . validators . MinLengthValidator ( 13 ) ] ) ) ,
( ' cached_ical_file_primary ' , models . TextField ( default = None , null = True ) ) ,
( ' prev_ical_file_primary ' , models . TextField ( default = None , null = True ) ) ,
( ' cached_ical_file_overrides ' , models . TextField ( default = None , null = True ) ) ,
( ' prev_ical_file_overrides ' , models . TextField ( default = None , null = True ) ) ,
( ' name ' , models . CharField ( max_length = 200 ) ) ,
( ' channel ' , models . CharField ( default = None , max_length = 100 , null = True ) ) ,
( ' current_shifts ' , models . TextField ( default = ' {} ' ) ) ,
( ' empty_oncall ' , models . BooleanField ( default = True ) ) ,
( ' notify_oncall_shift_freq ' , models . IntegerField ( choices = [ ( 0 , ' Never ' ) , ( 1 , ' Each shift ' ) ] , default = 1 ) ) ,
( ' mention_oncall_start ' , models . BooleanField ( default = True ) ) ,
( ' mention_oncall_next ' , models . BooleanField ( default = False ) ) ,
( ' notify_empty_oncall ' , models . IntegerField ( choices = [ ( 0 , ' Notify all people in the channel ' ) , ( 1 , ' Mention person from the previous slot ' ) , ( 2 , ' Inform about empty slot ' ) ] , default = 0 ) ) ,
( ' has_gaps ' , models . BooleanField ( default = False ) ) ,
( ' gaps_report_sent_at ' , models . DateField ( default = None , null = True ) ) ,
( ' has_empty_shifts ' , models . BooleanField ( default = False ) ) ,
( ' empty_shifts_report_sent_at ' , models . DateField ( default = None , null = True ) ) ,
] ,
) ,
migrations . CreateModel (
name = ' OnCallScheduleCalendar ' ,
fields = [
( ' oncallschedule_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' schedules.oncallschedule ' ) ) ,
( ' ical_url_overrides ' , models . CharField ( default = None , max_length = 500 , null = True ) ) ,
( ' ical_file_error_overrides ' , models . CharField ( default = None , max_length = 200 , null = True ) ) ,
( ' time_zone ' , models . CharField ( default = ' UTC ' , max_length = 100 ) ) ,
] ,
options = {
' abstract ' : False ,
' base_manager_name ' : ' objects ' ,
} ,
bases = ( ' schedules.oncallschedule ' , ) ,
) ,
migrations . CreateModel (
name = ' OnCallScheduleICal ' ,
fields = [
( ' oncallschedule_ptr ' , models . OneToOneField ( auto_created = True , on_delete = django . db . models . deletion . CASCADE , parent_link = True , primary_key = True , serialize = False , to = ' schedules.oncallschedule ' ) ) ,
( ' ical_url_primary ' , models . CharField ( default = None , max_length = 500 , null = True ) ) ,
( ' ical_file_error_primary ' , models . CharField ( default = None , max_length = 200 , null = True ) ) ,
( ' ical_url_overrides ' , models . CharField ( default = None , max_length = 500 , null = True ) ) ,
( ' ical_file_error_overrides ' , models . CharField ( default = None , max_length = 200 , null = True ) ) ,
] ,
options = {
' abstract ' : False ,
' base_manager_name ' : ' objects ' ,
} ,
bases = ( ' schedules.oncallschedule ' , ) ,
) ,
]