# What this PR does This PR adds [django-migration-linter](https://github.com/3YOURMIND/django-migration-linter) to keep database migrations backwards compatible - we can automatically run migrations and they are zero-downtime, e.g. old code can work with the migrated database - we can run and rollback migrations without worrying about data safety - OnCall is deployed to the multiple environments core team is not able to control See [django-migration-linter checklist](https://github.com/3YOURMIND/django-migration-linter/blob/main/docs/incompatibilities.md) for the common mistakes and best practices ## Which issue(s) this PR fixes ## Checklist - [ ] Tests updated - [ ] Documentation added - [ ] `CHANGELOG.md` updated --------- Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
69 lines
2.8 KiB
Python
69 lines
2.8 KiB
Python
# Generated by Django 3.2.5 on 2022-05-31 14:46
|
|
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import django_migration_linter as linter
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('user_management', '0001_squashed_initial'),
|
|
('slack', '0002_squashed_initial'),
|
|
('contenttypes', '0002_remove_content_type_name'),
|
|
('schedules', '0001_squashed_initial'),
|
|
]
|
|
|
|
operations = [
|
|
linter.IgnoreMigration(),
|
|
migrations.AddField(
|
|
model_name='oncallschedule',
|
|
name='organization',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='oncall_schedules', to='user_management.organization'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='oncallschedule',
|
|
name='polymorphic_ctype',
|
|
field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_schedules.oncallschedule_set+', to='contenttypes.contenttype'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='oncallschedule',
|
|
name='team',
|
|
field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='oncall_schedules', to='user_management.team'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='oncallschedule',
|
|
name='user_group',
|
|
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='oncall_schedules', to='slack.slackusergroup'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='customoncallshift',
|
|
name='organization',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='custom_on_call_shifts', to='user_management.organization'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='customoncallshift',
|
|
name='team',
|
|
field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='custom_on_call_shifts', to='user_management.team'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='customoncallshift',
|
|
name='users',
|
|
field=models.ManyToManyField(to='user_management.User'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='oncallschedulecalendar',
|
|
name='custom_on_call_shifts',
|
|
field=models.ManyToManyField(related_name='schedules', to='schedules.CustomOnCallShift'),
|
|
),
|
|
migrations.AlterUniqueTogether(
|
|
name='oncallschedule',
|
|
unique_together={('name', 'organization')},
|
|
),
|
|
migrations.AlterUniqueTogether(
|
|
name='customoncallshift',
|
|
unique_together={('name', 'organization')},
|
|
),
|
|
]
|