From ecd2c19b265e3974707da0d9b8e260749dcf4a9f Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 21 Oct 2020 17:08:24 +0100 Subject: renamed a field in a model to date and look what I need! new migrations and fixed tests --- ctrack/register/migrations/0001_initial.py | 43 ++++++++--- .../register/migrations/0002_auto_20201014_1605.py | 75 ------------------- .../register/migrations/0002_auto_20201021_1551.py | 85 ++++++++++++++++++++++ .../register/migrations/0003_auto_20201015_1955.py | 19 ----- .../register/migrations/0004_auto_20201017_1958.py | 33 --------- .../register/migrations/0005_auto_20201019_0928.py | 24 ------ .../register/migrations/0006_auto_20201019_1935.py | 43 ----------- 7 files changed, 117 insertions(+), 205 deletions(-) delete mode 100644 ctrack/register/migrations/0002_auto_20201014_1605.py create mode 100644 ctrack/register/migrations/0002_auto_20201021_1551.py delete mode 100644 ctrack/register/migrations/0003_auto_20201015_1955.py delete mode 100644 ctrack/register/migrations/0004_auto_20201017_1958.py delete mode 100644 ctrack/register/migrations/0005_auto_20201019_0928.py delete mode 100644 ctrack/register/migrations/0006_auto_20201019_1935.py (limited to 'ctrack/register/migrations') diff --git a/ctrack/register/migrations/0001_initial.py b/ctrack/register/migrations/0001_initial.py index 1986518..863c575 100644 --- a/ctrack/register/migrations/0001_initial.py +++ b/ctrack/register/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.1.2 on 2020-10-14 16:05 +# Generated by Django 3.1.2 on 2020-10-21 15:51 from django.db import migrations, models @@ -19,10 +19,10 @@ class Migration(migrations.Migration): ('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)), + ('document_link', models.URLField(blank=True, help_text='Use this to link to documents on TiME/Sharepoint or elsewhere.', 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)), + ('date', models.DateField(help_text='DD/MM/YY format')), + ('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')], help_text='Select the event type', max_length=50, verbose_name='Type')), ], ), migrations.CreateModel( @@ -32,9 +32,9 @@ class Migration(migrations.Migration): ('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)), + ('document_link', models.URLField(blank=True, help_text='Use this to link to documents on TiME/Sharepoint or elsewhere.', 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()), + ('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)), ], @@ -63,6 +63,25 @@ class Migration(migrations.Migration): ('single_date_type', models.BooleanField(default=False)), ], ), + migrations.CreateModel( + name='NoteEvent', + 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='Use this to link to documents on TiME/Sharepoint or elsewhere.', 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)), + ('url', models.URLField(blank=True, help_text='If recording an email, please link to it here. Do not paste the text in the comments box.', max_length=400, null=True, verbose_name='URL')), + ('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)), + ('private', models.BooleanField(default=False, help_text='Private events can only be seen by you. Official records should not be private, but you can use private events to track your own work.')), + ('type_descriptor', models.CharField(default='NOTE', max_length=50)), + ], + options={ + 'abstract': False, + }, + ), migrations.CreateModel( name='SingleDateTimeEvent', fields=[ @@ -70,14 +89,16 @@ class Migration(migrations.Migration): ('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)), + ('document_link', models.URLField(blank=True, help_text='Use this to link to documents on TiME/Sharepoint or elsewhere.', 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')), + ('location', models.CharField(blank=True, help_text='If event involved a physical location, indicate here.', max_length=100)), + ('url', models.URLField(blank=True, help_text='If recording an email, please link to it here. Do not paste the text in the comments box.', max_length=400, null=True, verbose_name='URL')), + ('date', 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')), + ('private', models.BooleanField(default=False, help_text='Private events can only be seen by you. Official records should not be private, but you can use private events to track your own work.')), + ('type_descriptor', models.CharField(choices=[('MEETING', 'Meeting'), ('PHONE_CALL', 'Phone Call'), ('VIDEO_CALL', 'Video Call'), ('EMAIL', 'Email')], max_length=50, verbose_name='Event Type')), + ('participants', models.ManyToManyField(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 deleted file mode 100644 index 0d4b440..0000000 --- a/ctrack/register/migrations/0002_auto_20201014_1605.py +++ /dev/null @@ -1,75 +0,0 @@ -# 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_auto_20201021_1551.py b/ctrack/register/migrations/0002_auto_20201021_1551.py new file mode 100644 index 0000000..93c02c8 --- /dev/null +++ b/ctrack/register/migrations/0002_auto_20201021_1551.py @@ -0,0 +1,85 @@ +# Generated by Django 3.1.2 on 2020-10-21 15:51 + +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 = [ + ('organisations', '0002_auto_20201021_1551'), + ('register', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('caf', '0002_auto_20201021_1551'), + ] + + 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='noteevent', + name='organisation', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organisations.organisation'), + ), + migrations.AddField( + model_name='noteevent', + 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('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/0003_auto_20201015_1955.py b/ctrack/register/migrations/0003_auto_20201015_1955.py deleted file mode 100644 index 58d11c1..0000000 --- a/ctrack/register/migrations/0003_auto_20201015_1955.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-15 19:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('organisations', '0002_auto_20201015_1955'), - ('register', '0002_auto_20201014_1605'), - ] - - operations = [ - migrations.AlterField( - model_name='singledatetimeevent', - name='participants', - field=models.ManyToManyField(blank=True, to='organisations.Person'), - ), - ] diff --git a/ctrack/register/migrations/0004_auto_20201017_1958.py b/ctrack/register/migrations/0004_auto_20201017_1958.py deleted file mode 100644 index d13903d..0000000 --- a/ctrack/register/migrations/0004_auto_20201017_1958.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-17 19:58 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('register', '0003_auto_20201015_1955'), - ] - - operations = [ - migrations.AddField( - model_name='singledatetimeevent', - name='private', - field=models.BooleanField(default=False, help_text='Private events can only be seen by you. Official records should not be private, but you can use private events to track your own work.'), - ), - migrations.AddField( - model_name='singledatetimeevent', - name='url', - field=models.URLField(blank=True, help_text='If recording an email, please link to it here. Do not paste the text in the comments box.', max_length=400, null=True, verbose_name='URL'), - ), - migrations.AlterField( - model_name='singledatetimeevent', - name='location', - field=models.CharField(blank=True, help_text='If event involved a physical location, indicate here.', max_length=100), - ), - migrations.AlterField( - model_name='singledatetimeevent', - name='type_descriptor', - field=models.CharField(choices=[('MEETING', 'Meeting'), ('PHONE_CALL', 'Phone Call'), ('VIDEO_CALL', 'Video Call'), ('EMAIL', 'Email'), ('NOTE', 'Note')], max_length=50), - ), - ] diff --git a/ctrack/register/migrations/0005_auto_20201019_0928.py b/ctrack/register/migrations/0005_auto_20201019_0928.py deleted file mode 100644 index ed6f6b5..0000000 --- a/ctrack/register/migrations/0005_auto_20201019_0928.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-19 09:28 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('organisations', '0002_auto_20201015_1955'), - ('register', '0004_auto_20201017_1958'), - ] - - operations = [ - migrations.AlterField( - model_name='singledatetimeevent', - name='participants', - field=models.ManyToManyField(to='organisations.Person'), - ), - migrations.AlterField( - model_name='singledatetimeevent', - name='type_descriptor', - field=models.CharField(choices=[('MEETING', 'Meeting'), ('PHONE_CALL', 'Phone Call'), ('VIDEO_CALL', 'Video Call'), ('EMAIL', 'Email'), ('NOTE', 'Note')], max_length=50, verbose_name='Event Type'), - ), - ] diff --git a/ctrack/register/migrations/0006_auto_20201019_1935.py b/ctrack/register/migrations/0006_auto_20201019_1935.py deleted file mode 100644 index 291b594..0000000 --- a/ctrack/register/migrations/0006_auto_20201019_1935.py +++ /dev/null @@ -1,43 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-19 19:35 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('organisations', '0002_auto_20201015_1955'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('register', '0005_auto_20201019_0928'), - ] - - operations = [ - migrations.AlterField( - model_name='singledatetimeevent', - name='type_descriptor', - field=models.CharField(choices=[('MEETING', 'Meeting'), ('PHONE_CALL', 'Phone Call'), ('VIDEO_CALL', 'Video Call'), ('EMAIL', 'Email')], max_length=50, verbose_name='Event Type'), - ), - migrations.CreateModel( - name='NoteEvent', - 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)), - ('url', models.URLField(blank=True, help_text='If recording an email, please link to it here. Do not paste the text in the comments box.', max_length=400, null=True, verbose_name='URL')), - ('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)), - ('private', models.BooleanField(default=False, help_text='Private events can only be seen by you. Official records should not be private, but you can use private events to track your own work.')), - ('type_descriptor', models.CharField(default='NOTE', max_length=50)), - ('organisation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organisations.organisation')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'abstract': False, - }, - ), - ] -- cgit v1.2.3