diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-14 17:08:54 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-14 17:08:54 +0100 |
commit | bdcc5d9d79f355eac6c2717b0b364b847b9a8115 (patch) | |
tree | fded47125bf031632db498a937225c64e841a56c /ctrack/register/migrations | |
parent | 14fa59eee9ba35ad462b5b17229a09164f5d716d (diff) |
reset a lot of migrations - all unit tests passing - now has response required fields for simple event
Diffstat (limited to '')
8 files changed, 132 insertions, 224 deletions
diff --git a/ctrack/register/migrations/0001_initial.py b/ctrack/register/migrations/0001_initial.py index 30a69ba..1986518 100644 --- a/ctrack/register/migrations/0001_initial.py +++ b/ctrack/register/migrations/0001_initial.py @@ -1,7 +1,6 @@ -# Generated by Django 2.2.12 on 2020-08-27 12:44 +# Generated by Django 3.1.2 on 2020-10-14 16:05 from django.db import migrations, models -import django.db.models.deletion class Migration(migrations.Migration): @@ -10,34 +9,78 @@ class Migration(migrations.Migration): dependencies = [ ('organisations', '0001_initial'), - ('caf', '0002_caf_systems'), ] operations = [ migrations.CreateModel( - name='EngagementType', + name='CAFSingleDateEvent', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('descriptor', models.CharField(max_length=50)), - ('enforcement_instrument', models.BooleanField(default=False)), - ('regulation_reference', models.CharField(blank=True, max_length=100, null=True)), - ('comments', models.TextField(blank=True, max_length=1000, null=True)), + ('created_date', models.DateTimeField()), + ('modified_date', models.DateTimeField()), + ('short_description', models.CharField(help_text='Short description of the event. Use Comments field for full detail.', max_length=50)), + ('document_link', models.URLField(blank=True, help_text='URL only - do not try to drag a file here.', max_length=1000, null=True)), + ('comments', models.TextField(blank=True, help_text='Use this to provide further detail about the event.', max_length=1000, null=True)), + ('date', models.DateField()), + ('type_descriptor', models.CharField(choices=[('CAF_INITIAL_CAF_RECEIVED', 'CAF - Initial CAF Received'), ('CAF_FEEDBACK_EMAILED_OES', 'CAF - Emailed to OES'), ('CAF_RECEIVED', 'CAF - Received'), ('CAF_EMAILED_ROSA', 'CAF - Emailed to Rosa'), ('CAF_VALIDATION_SIGN_OFF', 'CAF - Validation Sign Off'), ('CAF_VALIDATION_RECORD_EMAILED_TO_OES', 'CAF - Validation Record Sent to OES')], max_length=50)), + ], + ), + migrations.CreateModel( + name='CAFTwinDateEvent', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateTimeField()), + ('modified_date', models.DateTimeField()), + ('short_description', models.CharField(help_text='Short description of the event. Use Comments field for full detail.', max_length=50)), + ('document_link', models.URLField(blank=True, help_text='URL only - do not try to drag a file here.', max_length=1000, null=True)), + ('comments', models.TextField(blank=True, help_text='Use this to provide further detail about the event.', max_length=1000, null=True)), + ('start_date', models.DateField()), + ('end_date', models.DateField(blank=True, null=True)), + ('type_descriptor', models.CharField(choices=[('CAF_PEER_REVIEW_PERIOD', 'CAF - Peer Review Period'), ('CAF_VALIDATION_PERIOD', 'CAF - Validation Period')], max_length=50)), ], ), migrations.CreateModel( name='EngagementEvent', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('short_description', models.CharField(help_text='Short description of the event', max_length=50)), + ('short_description', models.CharField(help_text='Short description of the event. Use Comments field for full detail.', max_length=50)), ('date', models.DateTimeField()), - ('end_date', models.DateTimeField(blank=True, null=True)), - ('document_link', models.URLField(blank=True, max_length=1000, null=True)), + ('end_date', models.DateTimeField(blank=True, help_text='Should be used for periodic events.', null=True)), + ('document_link', models.URLField(blank=True, help_text='URL only - do not try to drag a file here.', max_length=1000, null=True)), ('response_date_requested', models.DateField(blank=True, null=True)), ('response_received', models.DateField(blank=True, null=True)), + ('comments', models.TextField(blank=True, help_text='Use this to provide further detail about the event.', max_length=1000, null=True)), + ], + ), + migrations.CreateModel( + name='EngagementType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('descriptor', models.CharField(max_length=100)), + ('enforcement_instrument', models.BooleanField(default=False)), + ('regulation_reference', models.CharField(blank=True, max_length=100, null=True)), ('comments', models.TextField(blank=True, max_length=1000, null=True)), - ('participants', models.ManyToManyField(to='organisations.Person')), - ('related_caf', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='caf.CAF')), - ('type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='register.EngagementType')), + ('single_date_type', models.BooleanField(default=False)), + ], + ), + migrations.CreateModel( + name='SingleDateTimeEvent', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateTimeField()), + ('modified_date', models.DateTimeField()), + ('short_description', models.CharField(help_text='Short description of the event. Use Comments field for full detail.', max_length=50)), + ('document_link', models.URLField(blank=True, help_text='URL only - do not try to drag a file here.', max_length=1000, null=True)), + ('comments', models.TextField(blank=True, help_text='Use this to provide further detail about the event.', max_length=1000, null=True)), + ('location', models.CharField(blank=True, max_length=100)), + ('datetime', models.DateTimeField(help_text='DD/MM/YY HH:MM format please!', verbose_name='Date/Time')), + ('requested_response_date', models.DateField(blank=True, help_text='DD/MM/YY format', null=True)), + ('response_received_date', models.DateField(blank=True, help_text='DD/MM/YY format', null=True)), + ('type_descriptor', models.CharField(choices=[('MEETING', 'Meeting'), ('PHONE_CALL', 'Phone Call'), ('VIDEO_CALL', 'Video Call'), ('EMAIL', 'Email')], max_length=50)), + ('participants', models.ManyToManyField(blank=True, null=True, to='organisations.Person')), ], + options={ + 'abstract': False, + }, ), ] diff --git a/ctrack/register/migrations/0002_auto_20201014_1605.py b/ctrack/register/migrations/0002_auto_20201014_1605.py new file mode 100644 index 0000000..0d4b440 --- /dev/null +++ b/ctrack/register/migrations/0002_auto_20201014_1605.py @@ -0,0 +1,75 @@ +# Generated by Django 3.1.2 on 2020-10-14 16:05 + +import ctrack.register.models +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.db.models.expressions + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('organisations', '0001_initial'), + ('caf', '0001_initial'), + ('register', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='singledatetimeevent', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='engagementevent', + name='participants', + field=models.ManyToManyField(blank=True, to='organisations.Person'), + ), + migrations.AddField( + model_name='engagementevent', + name='related_caf', + field=models.ForeignKey(blank=True, help_text='If the event relates to a CAF, refer to it here.', null=True, on_delete=django.db.models.deletion.CASCADE, to='caf.caf'), + ), + migrations.AddField( + model_name='engagementevent', + name='type', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='register.engagementtype'), + ), + migrations.AddField( + model_name='engagementevent', + name='user', + field=models.ForeignKey(on_delete=models.SET(ctrack.register.models.EngagementEvent.get_sentinel_user), to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='caftwindateevent', + name='related_caf', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='caf.caf'), + ), + migrations.AddField( + model_name='caftwindateevent', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='cafsingledateevent', + name='related_caf', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='caf.caf'), + ), + migrations.AddField( + model_name='cafsingledateevent', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + migrations.AddConstraint( + model_name='caftwindateevent', + constraint=models.CheckConstraint(check=models.Q(_negated=True, end_date__lt=django.db.models.expressions.F('start_date')), name='register_caftwindateevent_cannot_precede_start_date'), + ), + migrations.AddConstraint( + model_name='cafsingledateevent', + constraint=models.UniqueConstraint(condition=models.Q(_negated=True, type_descriptor='CAF_EMAILED_ROSA'), fields=('date', 'type_descriptor'), name='unique_caf_for_date'), + ), + ] diff --git a/ctrack/register/migrations/0002_engagementevent_user.py b/ctrack/register/migrations/0002_engagementevent_user.py deleted file mode 100644 index 56866dc..0000000 --- a/ctrack/register/migrations/0002_engagementevent_user.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.2.12 on 2020-08-27 12:44 - -import ctrack.register.models -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('register', '0001_initial'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.AddField( - model_name='engagementevent', - name='user', - field=models.ForeignKey(on_delete=models.SET(ctrack.register.models.EngagementEvent.get_sentinel_user), to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/ctrack/register/migrations/0003_auto_20201001_1036.py b/ctrack/register/migrations/0003_auto_20201001_1036.py deleted file mode 100644 index 2bf0447..0000000 --- a/ctrack/register/migrations/0003_auto_20201001_1036.py +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by Django 2.2.12 on 2020-10-01 10:36 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('register', '0002_engagementevent_user'), - ] - - operations = [ - migrations.AlterField( - model_name='engagementevent', - name='comments', - field=models.TextField(blank=True, help_text='Use this to provide further detail about the event.', max_length=1000, null=True), - ), - migrations.AlterField( - model_name='engagementevent', - name='document_link', - field=models.URLField(blank=True, help_text='URL only - do not try to drag a file here', max_length=1000, null=True), - ), - migrations.AlterField( - model_name='engagementevent', - name='participants', - field=models.ManyToManyField(blank=True, null=True, to='organisations.Person'), - ), - migrations.AlterField( - model_name='engagementevent', - name='related_caf', - field=models.ForeignKey(blank=True, help_text='If the event relates to a CAF, refer to it here.', null=True, on_delete=django.db.models.deletion.CASCADE, to='caf.CAF'), - ), - migrations.AlterField( - model_name='engagementevent', - name='short_description', - field=models.CharField(help_text='Short description of the event. Use Comments field for full detail.', max_length=50), - ), - ] diff --git a/ctrack/register/migrations/0004_auto_20201002_1516.py b/ctrack/register/migrations/0004_auto_20201002_1516.py deleted file mode 100644 index 206cf9b..0000000 --- a/ctrack/register/migrations/0004_auto_20201002_1516.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 2.2.12 on 2020-10-02 15:16 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('register', '0003_auto_20201001_1036'), - ] - - operations = [ - migrations.AlterField( - model_name='engagementevent', - name='document_link', - field=models.URLField(blank=True, help_text='URL only - do not try to drag a file here.', max_length=1000, null=True), - ), - migrations.AlterField( - model_name='engagementevent', - name='end_date', - field=models.DateTimeField(blank=True, help_text='Should be used for periodic events.', null=True), - ), - migrations.AlterField( - model_name='engagementtype', - name='descriptor', - field=models.CharField(max_length=100), - ), - ] diff --git a/ctrack/register/migrations/0005_auto_20201002_1536.py b/ctrack/register/migrations/0005_auto_20201002_1536.py deleted file mode 100644 index 2fce0b1..0000000 --- a/ctrack/register/migrations/0005_auto_20201002_1536.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.12 on 2020-10-02 15:36 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('register', '0004_auto_20201002_1516'), - ] - - operations = [ - migrations.AlterField( - model_name='engagementevent', - name='participants', - field=models.ManyToManyField(blank=True, to='organisations.Person'), - ), - ] diff --git a/ctrack/register/migrations/0006_engagementtype_single_date_type.py b/ctrack/register/migrations/0006_engagementtype_single_date_type.py deleted file mode 100644 index fdc0d1f..0000000 --- a/ctrack/register/migrations/0006_engagementtype_single_date_type.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.12 on 2020-10-02 18:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('register', '0005_auto_20201002_1536'), - ] - - operations = [ - migrations.AddField( - model_name='engagementtype', - name='single_date_type', - field=models.BooleanField(default=False), - ), - ] diff --git a/ctrack/register/migrations/0007_auto_20201013_1250.py b/ctrack/register/migrations/0007_auto_20201013_1250.py deleted file mode 100644 index 9dc4cfb..0000000 --- a/ctrack/register/migrations/0007_auto_20201013_1250.py +++ /dev/null @@ -1,84 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-13 12:50 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import django.db.models.expressions - - -class Migration(migrations.Migration): - - dependencies = [ - ('caf', '0002_caf_systems'), - ('organisations', '0001_initial'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('register', '0006_engagementtype_single_date_type'), - ] - - operations = [ - migrations.CreateModel( - name='CAFMixin', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('related_caf', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='caf.caf')), - ], - ), - migrations.CreateModel( - name='SingleDateTimeEvent', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_date', models.DateTimeField()), - ('modified_date', models.DateTimeField()), - ('short_description', models.CharField(help_text='Short description of the event. Use Comments field for full detail.', max_length=50)), - ('document_link', models.URLField(blank=True, help_text='URL only - do not try to drag a file here.', max_length=1000, null=True)), - ('comments', models.TextField(blank=True, help_text='Use this to provide further detail about the event.', max_length=1000, null=True)), - ('location', models.CharField(blank=True, max_length=100)), - ('datetime', models.DateTimeField()), - ('type_descriptor', models.CharField(choices=[('MEETING', 'Meeting'), ('PHONE_CALL', 'Phone Call'), ('VIDEO_CALL', 'Video Call')], max_length=50)), - ('participants', models.ManyToManyField(blank=True, null=True, to='organisations.Person')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='CAFTwinDateEvent', - fields=[ - ('cafmixin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='register.cafmixin')), - ('created_date', models.DateTimeField()), - ('modified_date', models.DateTimeField()), - ('short_description', models.CharField(help_text='Short description of the event. Use Comments field for full detail.', max_length=50)), - ('document_link', models.URLField(blank=True, help_text='URL only - do not try to drag a file here.', max_length=1000, null=True)), - ('comments', models.TextField(blank=True, help_text='Use this to provide further detail about the event.', max_length=1000, null=True)), - ('start_date', models.DateField()), - ('end_date', models.DateField(blank=True, null=True)), - ('type_descriptor', models.CharField(choices=[('CAF_PEER_REVIEW_PERIOD', 'CAF - Peer Review Period'), ('CAF_VALIDATION_PERIOD', 'CAF - Validation Period')], max_length=50)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - bases=('register.cafmixin', models.Model), - ), - migrations.CreateModel( - name='CAFSingleDateEvent', - fields=[ - ('cafmixin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='register.cafmixin')), - ('created_date', models.DateTimeField()), - ('modified_date', models.DateTimeField()), - ('short_description', models.CharField(help_text='Short description of the event. Use Comments field for full detail.', max_length=50)), - ('document_link', models.URLField(blank=True, help_text='URL only - do not try to drag a file here.', max_length=1000, null=True)), - ('comments', models.TextField(blank=True, help_text='Use this to provide further detail about the event.', max_length=1000, null=True)), - ('date', models.DateField()), - ('type_descriptor', models.CharField(choices=[('CAF_INITIAL_CAF_RECEIVED', 'CAF - Initial CAF Received'), ('CAF_FEEDBACK_EMAILED_OES', 'CAF - Emailed to OES'), ('CAF_RECEIVED', 'CAF - Received'), ('CAF_EMAILED_ROSA', 'CAF - Emailed to Rosa'), ('CAF_VALIDATION_SIGN_OFF', 'CAF - Validation Sign Off'), ('CAF_VALIDATION_RECORD_EMAILED_TO_OES', 'CAF - Validation Record Sent to OES')], max_length=50)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - bases=('register.cafmixin', models.Model), - ), - migrations.AddConstraint( - model_name='caftwindateevent', - constraint=models.CheckConstraint(check=models.Q(_negated=True, end_date__lt=django.db.models.expressions.F('start_date')), name='register_caftwindateevent_cannot_precede_start_date'), - ), - migrations.AddConstraint( - model_name='cafsingledateevent', - constraint=models.UniqueConstraint(condition=models.Q(_negated=True, type_descriptor='CAF_EMAILED_ROSA'), fields=('date', 'type_descriptor'), name='unique_caf_for_date'), - ), - ] |