diff --git a/cbrsservices/migrations/0001_initial.py b/cbrsservices/migrations/0001_initial.py index 5b3ecf0..0028b15 100644 --- a/cbrsservices/migrations/0001_initial.py +++ b/cbrsservices/migrations/0001_initial.py @@ -55,10 +55,10 @@ class Migration(migrations.Migration): ('from_requester', models.BooleanField(default=False)), ('final_letter', models.BooleanField(default=False)), ('uploaded_date', models.DateField(null=True, auto_now_add=True)), - ('case', models.ForeignKey(related_name='case_files', to='cbrsservices.Case')), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='casefile_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='casefile_modifier', to=settings.AUTH_USER_MODEL)), - ('uploader', models.ForeignKey(blank=True, null=True, related_name='case_files', to=settings.AUTH_USER_MODEL)), + ('case', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='case_files', to='cbrsservices.Case')), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='casefile_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='casefile_modifier', to=settings.AUTH_USER_MODEL)), + ('uploader', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='case_files', to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'cbrs_casefile', @@ -70,9 +70,9 @@ class Migration(migrations.Migration): ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)), ('created_date', models.DateField(blank=True, null=True, db_index=True, default=datetime.date.today)), ('modified_date', models.DateField(null=True, auto_now=True)), - ('case', models.ForeignKey(to='cbrsservices.Case')), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='casetag_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='casetag_modifier', to=settings.AUTH_USER_MODEL)), + ('case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cbrsservices.Case')), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='casetag_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='casetag_modifier', to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'cbrs_casetag', @@ -85,9 +85,9 @@ class Migration(migrations.Migration): ('created_date', models.DateField(blank=True, null=True, db_index=True, default=datetime.date.today)), ('modified_date', models.DateField(null=True, auto_now=True)), ('comment', models.TextField()), - ('acase', models.ForeignKey(related_name='comments', to='cbrsservices.Case')), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='comment_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='comment_modifier', to=settings.AUTH_USER_MODEL)), + ('acase', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='cbrsservices.Case')), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='comment_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='comment_modifier', to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'cbrs_comment', @@ -102,8 +102,8 @@ class Migration(migrations.Migration): ('modified_date', models.DateField(null=True, auto_now=True)), ('determination', models.CharField(max_length=32, unique=True)), ('description', models.TextField(blank=True)), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='determination_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='determination_modifier', to=settings.AUTH_USER_MODEL)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='determination_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='determination_modifier', to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'cbrs_determination', @@ -121,8 +121,8 @@ class Migration(migrations.Migration): ('field_agent_email', models.CharField(max_length=255, blank=True, validators=[django.core.validators.EmailValidator])), ('city', models.CharField(max_length=255, blank=True)), ('state', localflavor.us.models.USStateField(max_length=2, blank=True, null=True, choices=[('AL', 'Alabama'), ('AK', 'Alaska'), ('AS', 'American Samoa'), ('AZ', 'Arizona'), ('AR', 'Arkansas'), ('AA', 'Armed Forces Americas'), ('AE', 'Armed Forces Europe'), ('AP', 'Armed Forces Pacific'), ('CA', 'California'), ('CO', 'Colorado'), ('CT', 'Connecticut'), ('DE', 'Delaware'), ('DC', 'District of Columbia'), ('FL', 'Florida'), ('GA', 'Georgia'), ('GU', 'Guam'), ('HI', 'Hawaii'), ('ID', 'Idaho'), ('IL', 'Illinois'), ('IN', 'Indiana'), ('IA', 'Iowa'), ('KS', 'Kansas'), ('KY', 'Kentucky'), ('LA', 'Louisiana'), ('ME', 'Maine'), ('MD', 'Maryland'), ('MA', 'Massachusetts'), ('MI', 'Michigan'), ('MN', 'Minnesota'), ('MS', 'Mississippi'), ('MO', 'Missouri'), ('MT', 'Montana'), ('NE', 'Nebraska'), ('NV', 'Nevada'), ('NH', 'New Hampshire'), ('NJ', 'New Jersey'), ('NM', 'New Mexico'), ('NY', 'New York'), ('NC', 'North Carolina'), ('ND', 'North Dakota'), ('MP', 'Northern Mariana Islands'), ('OH', 'Ohio'), ('OK', 'Oklahoma'), ('OR', 'Oregon'), ('PA', 'Pennsylvania'), ('PR', 'Puerto Rico'), ('RI', 'Rhode Island'), ('SC', 'South Carolina'), ('SD', 'South Dakota'), ('TN', 'Tennessee'), ('TX', 'Texas'), ('UT', 'Utah'), ('VT', 'Vermont'), ('VI', 'Virgin Islands'), ('VA', 'Virginia'), ('WA', 'Washington'), ('WV', 'West Virginia'), ('WI', 'Wisconsin'), ('WY', 'Wyoming')])), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='fieldoffice_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='fieldoffice_modifier', to=settings.AUTH_USER_MODEL)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='fieldoffice_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='fieldoffice_modifier', to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'cbrs_fieldoffice', @@ -181,8 +181,8 @@ class Migration(migrations.Migration): ('legal_description', models.CharField(max_length=255, blank=True)), ('subdivision', models.CharField(max_length=255, blank=True)), ('policy_number', models.CharField(max_length=255, blank=True)), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='property_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='property_modifier', to=settings.AUTH_USER_MODEL)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='property_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='property_modifier', to=settings.AUTH_USER_MODEL)), ], options={ 'verbose_name_plural': 'properties', @@ -205,8 +205,8 @@ class Migration(migrations.Migration): ('last_name', models.CharField(max_length=255, blank=True)), ('organization', models.CharField(max_length=255, blank=True)), ('email', models.CharField(max_length=255, blank=True, validators=[django.core.validators.EmailValidator])), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='requester_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='requester_modifier', to=settings.AUTH_USER_MODEL)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='requester_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='requester_modifier', to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'cbrs_requester', @@ -222,8 +222,8 @@ class Migration(migrations.Migration): ('map_title', models.CharField(max_length=255, blank=True)), ('map_date', models.DateField()), ('effective', models.BooleanField(default=True)), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='systemmap_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='systemmap_modifier', to=settings.AUTH_USER_MODEL)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='systemmap_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='systemmap_modifier', to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'cbrs_systemmap', @@ -237,9 +237,9 @@ class Migration(migrations.Migration): ('modified_date', models.DateField(null=True, auto_now=True)), ('system_unit_number', models.CharField(max_length=16, unique=True)), ('system_unit_name', models.CharField(max_length=255, blank=True)), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='systemunit_creator', to=settings.AUTH_USER_MODEL)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='systemunit_creator', to=settings.AUTH_USER_MODEL)), ('field_office', models.ForeignKey(blank=True, null=True, related_name='system_units', on_delete=django.db.models.deletion.PROTECT, to='cbrsservices.FieldOffice')), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='systemunit_modifier', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='systemunit_modifier', to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'cbrs_systemunit', @@ -252,10 +252,10 @@ class Migration(migrations.Migration): ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)), ('created_date', models.DateField(blank=True, null=True, db_index=True, default=datetime.date.today)), ('modified_date', models.DateField(null=True, auto_now=True)), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='systemunitmap_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='systemunitmap_modifier', to=settings.AUTH_USER_MODEL)), - ('system_map', models.ForeignKey(to='cbrsservices.SystemMap')), - ('system_unit', models.ForeignKey(to='cbrsservices.SystemUnit')), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='systemunitmap_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='systemunitmap_modifier', to=settings.AUTH_USER_MODEL)), + ('system_map', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cbrsservices.SystemMap')), + ('system_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cbrsservices.SystemUnit')), ], options={ 'db_table': 'cbrs_systemunitmap', @@ -268,9 +268,9 @@ class Migration(migrations.Migration): ('created_date', models.DateField(blank=True, null=True, db_index=True, default=datetime.date.today)), ('modified_date', models.DateField(null=True, auto_now=True)), ('prohibition_date', models.DateField()), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='systemunitprohibitiondate_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='systemunitprohibitiondate_modifier', to=settings.AUTH_USER_MODEL)), - ('system_unit', models.ForeignKey(related_name='prohibition_dates', to='cbrsservices.SystemUnit')), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='systemunitprohibitiondate_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='systemunitprohibitiondate_modifier', to=settings.AUTH_USER_MODEL)), + ('system_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='prohibition_dates', to='cbrsservices.SystemUnit')), ], options={ 'db_table': 'cbrs_systemunitprohibitiondate', @@ -284,8 +284,8 @@ class Migration(migrations.Migration): ('created_date', models.DateField(blank=True, null=True, db_index=True, default=datetime.date.today)), ('modified_date', models.DateField(null=True, auto_now=True)), ('unit_type', models.CharField(max_length=16, unique=True)), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='systemunittype_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='systemunittype_modifier', to=settings.AUTH_USER_MODEL)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='systemunittype_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='systemunittype_modifier', to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'cbrs_systemunittype', @@ -300,8 +300,8 @@ class Migration(migrations.Migration): ('modified_date', models.DateField(null=True, auto_now=True)), ('name', models.CharField(max_length=255, unique=True)), ('description', models.TextField(blank=True)), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='tag_creator', to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='tag_modifier', to=settings.AUTH_USER_MODEL)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='tag_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='tag_modifier', to=settings.AUTH_USER_MODEL)), ], options={ 'db_table': 'cbrs_tag', @@ -335,7 +335,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='casetag', name='tag', - field=models.ForeignKey(to='cbrsservices.Tag'), + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cbrsservices.Tag'), ), migrations.AddField( model_name='case', @@ -345,7 +345,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='case', name='created_by', - field=models.ForeignKey(blank=True, null=True, related_name='case_creator', to=settings.AUTH_USER_MODEL), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='case_creator', to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='case', @@ -355,7 +355,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='case', name='duplicate', - field=models.ForeignKey(blank=True, null=True, to='cbrsservices.Case'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, to='cbrsservices.Case'), ), migrations.AddField( model_name='case', @@ -370,7 +370,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='case', name='modified_by', - field=models.ForeignKey(blank=True, null=True, related_name='case_modifier', to=settings.AUTH_USER_MODEL), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, null=True, related_name='case_modifier', to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='case', diff --git a/cbrsservices/migrations/0001_squashed_0002_auto_20190806_1609.py b/cbrsservices/migrations/0001_squashed_0002_auto_20190806_1609.py new file mode 100644 index 0000000..6d6ab33 --- /dev/null +++ b/cbrsservices/migrations/0001_squashed_0002_auto_20190806_1609.py @@ -0,0 +1,1009 @@ +# Generated by Django 2.1.9 on 2019-08-06 16:45 + +import cbrsservices.models +import datetime +from django.conf import settings +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import localflavor.us.models + + +class Migration(migrations.Migration): + + replaces = [('cbrsservices', '0001_initial'), ('cbrsservices', '0002_auto_20190806_1609')] + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Case', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('case_reference', models.CharField(blank=True, max_length=255)), + ('request_date', models.DateField(blank=True, default=datetime.date.today, null=True)), + ('cbrs_map_date', models.DateField(blank=True, null=True)), + ('prohibition_date', models.DateField(blank=True, null=True)), + ('distance', models.FloatField(blank=True, null=True)), + ('fws_fo_received_date', models.DateField(blank=True, null=True)), + ('fws_hq_received_date', models.DateField(blank=True, null=True)), + ('final_letter_date', models.DateField(blank=True, null=True)), + ('close_date', models.DateField(blank=True, null=True)), + ('final_letter_recipient', models.CharField(blank=True, max_length=255)), + ('analyst_signoff_date', models.DateField(blank=True, null=True)), + ('qc_reviewer_signoff_date', models.DateField(blank=True, null=True)), + ('fws_reviewer_signoff_date', models.DateField(blank=True, null=True)), + ('priority', models.BooleanField(default=False)), + ('on_hold', models.BooleanField(default=False)), + ('invalid', models.BooleanField(default=False)), + ('analyst', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='analyst', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_case', + }, + ), + migrations.CreateModel( + name='CaseFile', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('file', models.FileField(upload_to=cbrsservices.models.CaseFile.casefile_location)), + ('from_requester', models.BooleanField(default=False)), + ('final_letter', models.BooleanField(default=False)), + ('uploaded_date', models.DateField(auto_now_add=True, null=True)), + ('case', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='case_files', to='cbrsservices.Case')), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='casefile_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='casefile_modifier', to=settings.AUTH_USER_MODEL)), + ('uploader', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='case_files', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_casefile', + }, + ), + migrations.CreateModel( + name='CaseTag', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cbrsservices.Case')), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='casetag_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='casetag_modifier', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_casetag', + }, + ), + migrations.CreateModel( + name='Comment', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('comment', models.TextField()), + ('acase', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='cbrsservices.Case')), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='comment_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='comment_modifier', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_comment', + 'ordering': ['-id'], + }, + ), + migrations.CreateModel( + name='Determination', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('determination', models.CharField(max_length=32, unique=True)), + ('description', models.TextField(blank=True)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='determination_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='determination_modifier', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_determination', + }, + ), + migrations.CreateModel( + name='FieldOffice', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('field_office_number', models.CharField(max_length=16, unique=True)), + ('field_office_name', models.CharField(blank=True, max_length=255)), + ('field_agent_name', models.CharField(blank=True, max_length=255)), + ('field_agent_email', models.CharField(blank=True, max_length=255, validators=[django.core.validators.EmailValidator])), + ('city', models.CharField(blank=True, max_length=255)), + ('state', localflavor.us.models.USStateField(blank=True, max_length=2, null=True)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='fieldoffice_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='fieldoffice_modifier', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_fieldoffice', + }, + ), + migrations.CreateModel( + name='HistoricalCaseTag', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('case', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Case')), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical case tag', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalSystemUnitMap', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical system unit map', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='Property', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('street', models.CharField(blank=True, max_length=255)), + ('unit', models.CharField(blank=True, max_length=255)), + ('city', models.CharField(blank=True, max_length=255)), + ('state', localflavor.us.models.USStateField(blank=True, max_length=2, null=True)), + ('zipcode', localflavor.us.models.USZipCodeField(blank=True, max_length=10, null=True)), + ('legal_description', models.CharField(blank=True, max_length=255)), + ('subdivision', models.CharField(blank=True, max_length=255)), + ('policy_number', models.CharField(blank=True, max_length=255)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='property_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='property_modifier', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name_plural': 'properties', + 'db_table': 'cbrs_property', + }, + ), + migrations.CreateModel( + name='Requester', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('street', models.CharField(blank=True, max_length=255)), + ('unit', models.CharField(blank=True, max_length=255)), + ('city', models.CharField(blank=True, max_length=255)), + ('state', localflavor.us.models.USStateField(blank=True, max_length=2, null=True)), + ('zipcode', localflavor.us.models.USZipCodeField(blank=True, max_length=10, null=True)), + ('salutation', models.CharField(blank=True, max_length=16)), + ('first_name', models.CharField(blank=True, max_length=255)), + ('last_name', models.CharField(blank=True, max_length=255)), + ('organization', models.CharField(blank=True, max_length=255)), + ('email', models.CharField(blank=True, max_length=255, validators=[django.core.validators.EmailValidator])), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='requester_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='requester_modifier', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_requester', + }, + ), + migrations.CreateModel( + name='SystemMap', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('map_number', models.CharField(max_length=16)), + ('map_title', models.CharField(blank=True, max_length=255)), + ('map_date', models.DateField()), + ('effective', models.BooleanField(default=True)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemmap_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemmap_modifier', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_systemmap', + }, + ), + migrations.CreateModel( + name='SystemUnit', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('system_unit_number', models.CharField(max_length=16, unique=True)), + ('system_unit_name', models.CharField(blank=True, max_length=255)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemunit_creator', to=settings.AUTH_USER_MODEL)), + ('field_office', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='system_units', to='cbrsservices.FieldOffice')), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemunit_modifier', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_systemunit', + 'ordering': ['system_unit_number'], + }, + ), + migrations.CreateModel( + name='SystemUnitMap', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemunitmap_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemunitmap_modifier', to=settings.AUTH_USER_MODEL)), + ('system_map', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cbrsservices.SystemMap')), + ('system_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cbrsservices.SystemUnit')), + ], + options={ + 'db_table': 'cbrs_systemunitmap', + }, + ), + migrations.CreateModel( + name='SystemUnitProhibitionDate', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('prohibition_date', models.DateField()), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemunitprohibitiondate_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemunitprohibitiondate_modifier', to=settings.AUTH_USER_MODEL)), + ('system_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='prohibition_dates', to='cbrsservices.SystemUnit')), + ], + options={ + 'db_table': 'cbrs_systemunitprohibitiondate', + 'ordering': ['-prohibition_date'], + }, + ), + migrations.CreateModel( + name='SystemUnitType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('unit_type', models.CharField(max_length=16, unique=True)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemunittype_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemunittype_modifier', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_systemunittype', + 'ordering': ['unit_type'], + }, + ), + migrations.CreateModel( + name='Tag', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(auto_now=True, null=True)), + ('name', models.CharField(max_length=255, unique=True)), + ('description', models.TextField(blank=True)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tag_creator', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tag_modifier', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'db_table': 'cbrs_tag', + }, + ), + migrations.AddField( + model_name='systemunit', + name='system_maps', + field=models.ManyToManyField(related_name='system_units', through='cbrsservices.SystemUnitMap', to='cbrsservices.SystemMap'), + ), + migrations.AddField( + model_name='systemunit', + name='system_unit_type', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='cbrsservices.SystemUnitType'), + ), + migrations.AddField( + model_name='historicalsystemunitmap', + name='system_map', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.SystemMap'), + ), + migrations.AddField( + model_name='historicalsystemunitmap', + name='system_unit', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.SystemUnit'), + ), + migrations.AddField( + model_name='historicalcasetag', + name='tag', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Tag'), + ), + migrations.AddField( + model_name='casetag', + name='tag', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cbrsservices.Tag'), + ), + migrations.AddField( + model_name='case', + name='cbrs_unit', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cbrsservices.SystemUnit'), + ), + migrations.AddField( + model_name='case', + name='created_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='case_creator', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='case', + name='determination', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cbrsservices.Determination'), + ), + migrations.AddField( + model_name='case', + name='duplicate', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cbrsservices.Case'), + ), + migrations.AddField( + model_name='case', + name='fws_reviewer', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='fws_reviewer', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='case', + name='map_number', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cbrsservices.SystemMap'), + ), + migrations.AddField( + model_name='case', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='case_modifier', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='case', + name='property', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='cases', to='cbrsservices.Property'), + ), + migrations.AddField( + model_name='case', + name='qc_reviewer', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='qc_reviewer', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='case', + name='requester', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='cases', to='cbrsservices.Requester'), + ), + migrations.AddField( + model_name='case', + name='tags', + field=models.ManyToManyField(related_name='cases', through='cbrsservices.CaseTag', to='cbrsservices.Tag'), + ), + migrations.CreateModel( + name='ReportCase', + fields=[ + ], + options={ + 'proxy': True, + }, + bases=('cbrsservices.case',), + ), + migrations.AlterUniqueTogether( + name='systemunitprohibitiondate', + unique_together={('prohibition_date', 'system_unit')}, + ), + migrations.AlterUniqueTogether( + name='systemunitmap', + unique_together={('system_unit', 'system_map')}, + ), + migrations.AlterField( + model_name='systemmap', + name='created_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemmap_creator', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemmap', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemmap_modifier', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterUniqueTogether( + name='systemmap', + unique_together={('map_number', 'map_date')}, + ), + migrations.AlterUniqueTogether( + name='requester', + unique_together={('salutation', 'first_name', 'last_name', 'organization', 'email', 'street', 'unit', 'city', 'state', 'zipcode')}, + ), + migrations.AlterUniqueTogether( + name='property', + unique_together={('street', 'unit', 'city', 'state', 'zipcode', 'legal_description')}, + ), + migrations.AlterUniqueTogether( + name='comment', + unique_together={('comment', 'acase')}, + ), + migrations.AlterField( + model_name='casetag', + name='created_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='casetag_creator', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='casetag', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='casetag_modifier', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterUniqueTogether( + name='casetag', + unique_together={('case', 'tag')}, + ), + migrations.AlterUniqueTogether( + name='casefile', + unique_together={('file', 'case')}, + ), + migrations.CreateModel( + name='HistoricalCase', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('case_reference', models.CharField(blank=True, max_length=255)), + ('request_date', models.DateField(blank=True, default=datetime.date.today, null=True)), + ('cbrs_map_date', models.DateField(blank=True, null=True)), + ('prohibition_date', models.DateField(blank=True, null=True)), + ('distance', models.FloatField(blank=True, null=True)), + ('fws_fo_received_date', models.DateField(blank=True, null=True)), + ('fws_hq_received_date', models.DateField(blank=True, null=True)), + ('final_letter_date', models.DateField(blank=True, null=True)), + ('close_date', models.DateField(blank=True, null=True)), + ('final_letter_recipient', models.CharField(blank=True, max_length=255)), + ('analyst_signoff_date', models.DateField(blank=True, null=True)), + ('qc_reviewer_signoff_date', models.DateField(blank=True, null=True)), + ('fws_reviewer_signoff_date', models.DateField(blank=True, null=True)), + ('priority', models.BooleanField(default=False)), + ('on_hold', models.BooleanField(default=False)), + ('invalid', models.BooleanField(default=False)), + ('hard_copy_map_reviewed', models.BooleanField(default=False)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('analyst', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical case', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalCaseFile', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('file', models.TextField(max_length=100)), + ('from_requester', models.BooleanField(default=False)), + ('final_letter', models.BooleanField(default=False)), + ('uploaded_date', models.DateField(blank=True, editable=False, null=True)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ], + options={ + 'verbose_name': 'historical case file', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalComment', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('comment', models.TextField()), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ], + options={ + 'verbose_name': 'historical comment', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalDetermination', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('determination', models.CharField(db_index=True, max_length=32)), + ('description', models.TextField(blank=True)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical determination', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalFieldOffice', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('field_office_number', models.CharField(db_index=True, max_length=16)), + ('field_office_name', models.CharField(blank=True, max_length=255)), + ('field_agent_name', models.CharField(blank=True, max_length=255)), + ('field_agent_email', models.CharField(blank=True, max_length=255, validators=[django.core.validators.EmailValidator])), + ('city', models.CharField(blank=True, max_length=255)), + ('state', localflavor.us.models.USStateField(blank=True, max_length=2, null=True)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical field office', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalProperty', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('street', models.CharField(blank=True, max_length=255)), + ('unit', models.CharField(blank=True, max_length=255)), + ('city', models.CharField(blank=True, max_length=255)), + ('state', localflavor.us.models.USStateField(blank=True, max_length=2, null=True)), + ('zipcode', localflavor.us.models.USZipCodeField(blank=True, max_length=10, null=True)), + ('legal_description', models.CharField(blank=True, max_length=255)), + ('subdivision', models.CharField(blank=True, max_length=255)), + ('policy_number', models.CharField(blank=True, max_length=255)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical property', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalReportCase', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('case_reference', models.CharField(blank=True, max_length=255)), + ('request_date', models.DateField(blank=True, default=datetime.date.today, null=True)), + ('cbrs_map_date', models.DateField(blank=True, null=True)), + ('prohibition_date', models.DateField(blank=True, null=True)), + ('distance', models.FloatField(blank=True, null=True)), + ('fws_fo_received_date', models.DateField(blank=True, null=True)), + ('fws_hq_received_date', models.DateField(blank=True, null=True)), + ('final_letter_date', models.DateField(blank=True, null=True)), + ('close_date', models.DateField(blank=True, null=True)), + ('final_letter_recipient', models.CharField(blank=True, max_length=255)), + ('analyst_signoff_date', models.DateField(blank=True, null=True)), + ('qc_reviewer_signoff_date', models.DateField(blank=True, null=True)), + ('fws_reviewer_signoff_date', models.DateField(blank=True, null=True)), + ('priority', models.BooleanField(default=False)), + ('on_hold', models.BooleanField(default=False)), + ('invalid', models.BooleanField(default=False)), + ('hard_copy_map_reviewed', models.BooleanField(default=False)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('analyst', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical report case', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalRequester', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('street', models.CharField(blank=True, max_length=255)), + ('unit', models.CharField(blank=True, max_length=255)), + ('city', models.CharField(blank=True, max_length=255)), + ('state', localflavor.us.models.USStateField(blank=True, max_length=2, null=True)), + ('zipcode', localflavor.us.models.USZipCodeField(blank=True, max_length=10, null=True)), + ('salutation', models.CharField(blank=True, max_length=16)), + ('first_name', models.CharField(blank=True, max_length=255)), + ('last_name', models.CharField(blank=True, max_length=255)), + ('organization', models.CharField(blank=True, max_length=255)), + ('email', models.CharField(blank=True, max_length=255, validators=[django.core.validators.EmailValidator])), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical requester', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalSystemMap', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('map_number', models.CharField(max_length=16)), + ('map_title', models.CharField(blank=True, max_length=255)), + ('map_date', models.DateField()), + ('effective', models.BooleanField(default=True)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical system map', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalSystemUnit', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('system_unit_number', models.CharField(db_index=True, max_length=16)), + ('system_unit_name', models.CharField(blank=True, max_length=255)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical system unit', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalSystemUnitProhibitionDate', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('prohibition_date', models.DateField()), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical system unit prohibition date', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalSystemUnitType', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('unit_type', models.CharField(db_index=True, max_length=16)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical system unit type', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.CreateModel( + name='HistoricalTag', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created_date', models.DateField(blank=True, db_index=True, default=datetime.date.today, null=True)), + ('modified_date', models.DateField(blank=True, editable=False, null=True)), + ('name', models.CharField(db_index=True, max_length=255)), + ('description', models.TextField(blank=True)), + ('history_id', models.AutoField(primary_key=True, serialize=False)), + ('history_date', models.DateTimeField()), + ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), + ('created_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'historical tag', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': 'history_date', + }, + ), + migrations.AddField( + model_name='case', + name='hard_copy_map_reviewed', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='case', + name='created_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='case_creator', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='case', + name='duplicate', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cbrsservices.Case'), + ), + migrations.AlterField( + model_name='case', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='case_modifier', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='casefile', + name='case', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='casefiles', to='cbrsservices.Case'), + ), + migrations.AlterField( + model_name='casefile', + name='created_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='casefile_creator', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='casefile', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='casefile_modifier', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='casefile', + name='uploader', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='casefiles', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='fieldoffice', + name='created_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='fieldoffice_creator', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='fieldoffice', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='fieldoffice_modifier', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemunit', + name='created_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemunit_creator', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemunit', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='systemunit_modifier', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalsystemunitprohibitiondate', + name='system_unit', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.SystemUnit'), + ), + migrations.AddField( + model_name='historicalsystemunit', + name='field_office', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.FieldOffice'), + ), + migrations.AddField( + model_name='historicalsystemunit', + name='history_user', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalsystemunit', + name='modified_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalsystemunit', + name='system_unit_type', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.SystemUnitType'), + ), + migrations.AddField( + model_name='historicalreportcase', + name='cbrs_unit', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.SystemUnit'), + ), + migrations.AddField( + model_name='historicalreportcase', + name='created_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalreportcase', + name='determination', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Determination'), + ), + migrations.AddField( + model_name='historicalreportcase', + name='duplicate', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Case'), + ), + migrations.AddField( + model_name='historicalreportcase', + name='fws_reviewer', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalreportcase', + name='history_user', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalreportcase', + name='map_number', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.SystemMap'), + ), + migrations.AddField( + model_name='historicalreportcase', + name='modified_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalreportcase', + name='property', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Property'), + ), + migrations.AddField( + model_name='historicalreportcase', + name='qc_reviewer', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalreportcase', + name='requester', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Requester'), + ), + migrations.AddField( + model_name='historicalcomment', + name='acase', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Case'), + ), + migrations.AddField( + model_name='historicalcomment', + name='created_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcomment', + name='history_user', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcomment', + name='modified_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcasefile', + name='case', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Case'), + ), + migrations.AddField( + model_name='historicalcasefile', + name='created_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcasefile', + name='history_user', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcasefile', + name='modified_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcasefile', + name='uploader', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcase', + name='cbrs_unit', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.SystemUnit'), + ), + migrations.AddField( + model_name='historicalcase', + name='created_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcase', + name='determination', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Determination'), + ), + migrations.AddField( + model_name='historicalcase', + name='duplicate', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Case'), + ), + migrations.AddField( + model_name='historicalcase', + name='fws_reviewer', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcase', + name='history_user', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcase', + name='map_number', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.SystemMap'), + ), + migrations.AddField( + model_name='historicalcase', + name='modified_by', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcase', + name='property', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Property'), + ), + migrations.AddField( + model_name='historicalcase', + name='qc_reviewer', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalcase', + name='requester', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='cbrsservices.Requester'), + ), + ] diff --git a/cbrsservices/migrations/0002_auto_20180403_1033.py b/cbrsservices/migrations/0002_auto_20180403_1033.py deleted file mode 100644 index bf20cf1..0000000 --- a/cbrsservices/migrations/0002_auto_20180403_1033.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - ('cbrsservices', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='casefile', - name='case', - field=models.ForeignKey(related_name='casefiles', to='cbrsservices.Case'), - ), - migrations.AlterField( - model_name='casefile', - name='uploader', - field=models.ForeignKey(blank=True, null=True, related_name='casefiles', to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/cbrsservices/migrations/0003_auto_20190805_1640.py b/cbrsservices/migrations/0002_auto_20190806_1609.py similarity index 74% rename from cbrsservices/migrations/0003_auto_20190805_1640.py rename to cbrsservices/migrations/0002_auto_20190806_1609.py index 4b8db83..8670481 100644 --- a/cbrsservices/migrations/0003_auto_20190805_1640.py +++ b/cbrsservices/migrations/0002_auto_20190806_1609.py @@ -2,18 +2,18 @@ from __future__ import unicode_literals from django.db import models, migrations -import django.db.models.deletion -import datetime import django.core.validators -from django.conf import settings import localflavor.us.models +from django.conf import settings +import django.db.models.deletion +import datetime class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('cbrsservices', '0002_auto_20180403_1033'), + ('cbrsservices', '0001_initial'), ] operations = [ @@ -36,17 +36,14 @@ class Migration(migrations.Migration): ('analyst_signoff_date', models.DateField(blank=True, null=True)), ('qc_reviewer_signoff_date', models.DateField(blank=True, null=True)), ('fws_reviewer_signoff_date', models.DateField(blank=True, null=True)), - ('hard_copy_map_reviewed', models.BooleanField(default=False)), ('priority', models.BooleanField(default=False)), ('on_hold', models.BooleanField(default=False)), ('invalid', models.BooleanField(default=False)), + ('hard_copy_map_reviewed', models.BooleanField(default=False)), ('history_id', models.AutoField(primary_key=True, serialize=False)), ('history_date', models.DateTimeField()), ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), ('analyst', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False)), - ('cbrs_unit', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.SystemUnit', db_constraint=False)), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False)), - ('determination', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.Determination', db_constraint=False)), ], options={ 'verbose_name': 'historical case', @@ -183,17 +180,14 @@ class Migration(migrations.Migration): ('analyst_signoff_date', models.DateField(blank=True, null=True)), ('qc_reviewer_signoff_date', models.DateField(blank=True, null=True)), ('fws_reviewer_signoff_date', models.DateField(blank=True, null=True)), - ('hard_copy_map_reviewed', models.BooleanField(default=False)), ('priority', models.BooleanField(default=False)), ('on_hold', models.BooleanField(default=False)), ('invalid', models.BooleanField(default=False)), + ('hard_copy_map_reviewed', models.BooleanField(default=False)), ('history_id', models.AutoField(primary_key=True, serialize=False)), ('history_date', models.DateTimeField()), ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), ('analyst', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False)), - ('cbrs_unit', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.SystemUnit', db_constraint=False)), - ('created_by', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False)), - ('determination', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.Determination', db_constraint=False)), ], options={ 'verbose_name': 'historical report case', @@ -265,10 +259,6 @@ class Migration(migrations.Migration): ('history_date', models.DateTimeField()), ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), ('created_by', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False)), - ('field_office', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.FieldOffice', db_constraint=False)), - ('history_user', models.ForeignKey(null=True, related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), - ('modified_by', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False)), - ('system_unit_type', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.SystemUnitType', db_constraint=False)), ], options={ 'verbose_name': 'historical system unit', @@ -289,7 +279,6 @@ class Migration(migrations.Migration): ('created_by', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False)), ('history_user', models.ForeignKey(null=True, related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ('modified_by', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False)), - ('system_unit', models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.SystemUnit', db_constraint=False)), ], options={ 'verbose_name': 'historical system unit prohibition date', @@ -343,6 +332,201 @@ class Migration(migrations.Migration): name='hard_copy_map_reviewed', field=models.BooleanField(default=False), ), + migrations.AlterField( + model_name='case', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='case_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='case', + name='duplicate', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cbrsservices.Case'), + ), + migrations.AlterField( + model_name='case', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='case_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='casefile', + name='case', + field=models.ForeignKey(related_name='casefiles', on_delete=django.db.models.deletion.PROTECT, to='cbrsservices.Case'), + ), + migrations.AlterField( + model_name='casefile', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='casefile_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='casefile', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='casefile_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='casefile', + name='uploader', + field=models.ForeignKey(blank=True, null=True, related_name='casefiles', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='casetag', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='casetag_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='casetag', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='casetag_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='comment', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='comment_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='comment', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='comment_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='determination', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='determination_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='determination', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='determination_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='fieldoffice', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='fieldoffice_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='fieldoffice', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='fieldoffice_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='property', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='property_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='property', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='property_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='requester', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='requester_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='requester', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='requester_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemmap', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='systemmap_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemmap', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='systemmap_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemunit', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='systemunit_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemunit', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='systemunit_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemunitmap', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='systemunitmap_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemunitmap', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='systemunitmap_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemunitprohibitiondate', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='systemunitprohibitiondate_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemunitprohibitiondate', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='systemunitprohibitiondate_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemunittype', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='systemunittype_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='systemunittype', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='systemunittype_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='tag', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='tag_creator', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='tag', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='tag_modifier', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalsystemunitprohibitiondate', + name='system_unit', + field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.SystemUnit', db_constraint=False), + ), + migrations.AddField( + model_name='historicalsystemunit', + name='field_office', + field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.FieldOffice', db_constraint=False), + ), + migrations.AddField( + model_name='historicalsystemunit', + name='history_user', + field=models.ForeignKey(null=True, related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='historicalsystemunit', + name='modified_by', + field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False), + ), + migrations.AddField( + model_name='historicalsystemunit', + name='system_unit_type', + field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.SystemUnitType', db_constraint=False), + ), + migrations.AddField( + model_name='historicalreportcase', + name='cbrs_unit', + field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.SystemUnit', db_constraint=False), + ), + migrations.AddField( + model_name='historicalreportcase', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False), + ), + migrations.AddField( + model_name='historicalreportcase', + name='determination', + field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.Determination', db_constraint=False), + ), migrations.AddField( model_name='historicalreportcase', name='duplicate', @@ -428,6 +612,21 @@ class Migration(migrations.Migration): name='uploader', field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False), ), + migrations.AddField( + model_name='historicalcase', + name='cbrs_unit', + field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.SystemUnit', db_constraint=False), + ), + migrations.AddField( + model_name='historicalcase', + name='created_by', + field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, db_constraint=False), + ), + migrations.AddField( + model_name='historicalcase', + name='determination', + field=models.ForeignKey(blank=True, null=True, related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, to='cbrsservices.Determination', db_constraint=False), + ), migrations.AddField( model_name='historicalcase', name='duplicate', diff --git a/cbrsservices/migrations/0002_auto_20190806_1647.py b/cbrsservices/migrations/0002_auto_20190806_1647.py new file mode 100644 index 0000000..c8d35fe --- /dev/null +++ b/cbrsservices/migrations/0002_auto_20190806_1647.py @@ -0,0 +1,88 @@ +# Generated by Django 2.1.9 on 2019-08-06 16:47 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cbrsservices', '0001_squashed_0002_auto_20190806_1609'), + ] + + operations = [ + migrations.AddField( + model_name='historicalcase', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalcasefile', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalcasetag', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalcomment', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicaldetermination', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalfieldoffice', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalproperty', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalreportcase', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalrequester', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalsystemmap', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalsystemunit', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalsystemunitmap', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalsystemunitprohibitiondate', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicalsystemunittype', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + migrations.AddField( + model_name='historicaltag', + name='history_change_reason', + field=models.CharField(max_length=100, null=True), + ), + ] diff --git a/cbrsservices/migrations/__init__.py b/cbrsservices/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cbrsservices/models.py b/cbrsservices/models.py index ab4522d..fcb8c3d 100644 --- a/cbrsservices/models.py +++ b/cbrsservices/models.py @@ -29,12 +29,12 @@ class HistoryModel(models.Model): """ created_date = models.DateField(default=date.today, null=True, blank=True, db_index=True) - created_by = models.ForeignKey(settings.AUTH_USER_MODEL, models.PROTECT, null=True, blank=True, db_index=True, + created_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, null=True, blank=True, db_index=True, related_name='%(class)s_creator') modified_date = models.DateField(auto_now=True, null=True, blank=True) - modified_by = models.ForeignKey(settings.AUTH_USER_MODEL, models.PROTECT, null=True, blank=True, db_index=True, + modified_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, null=True, blank=True, db_index=True, related_name='%(class)s_modifier') - history = HistoricalRecords() + history = HistoricalRecords(inherit=True) class Meta: abstract = True @@ -122,15 +122,15 @@ def send_final_email(self): case_number = property(_get_id) case_reference = models.CharField(max_length=255, blank=True) - duplicate = models.ForeignKey('self', models.PROTECT, null=True, blank=True) + duplicate = models.ForeignKey('self', on_delete=models.PROTECT, null=True, blank=True) status = property(_get_status) request_date = models.DateField(default=date.today, null=True, blank=True) - requester = models.ForeignKey('Requester', models.PROTECT, related_name='cases') - property = models.ForeignKey('Property', models.PROTECT, related_name='cases') - cbrs_unit = models.ForeignKey('SystemUnit', models.PROTECT, null=True, blank=True) - map_number = models.ForeignKey('SystemMap', models.PROTECT, null=True, blank=True) + requester = models.ForeignKey('Requester', on_delete=models.PROTECT, related_name='cases') + property = models.ForeignKey('Property', on_delete=models.PROTECT, related_name='cases') + cbrs_unit = models.ForeignKey('SystemUnit', on_delete=models.PROTECT, null=True, blank=True) + map_number = models.ForeignKey('SystemMap', on_delete=models.PROTECT, null=True, blank=True) cbrs_map_date = models.DateField(null=True, blank=True) - determination = models.ForeignKey('Determination', models.PROTECT, null=True, blank=True) + determination = models.ForeignKey('Determination', on_delete=models.PROTECT, null=True, blank=True) prohibition_date = models.DateField(null=True, blank=True) distance = models.FloatField(null=True, blank=True) fws_fo_received_date = models.DateField(null=True, blank=True) @@ -138,12 +138,12 @@ def send_final_email(self): final_letter_date = models.DateField(null=True, blank=True) close_date = models.DateField(null=True, blank=True) final_letter_recipient = models.CharField(max_length=255, blank=True) - analyst = models.ForeignKey(settings.AUTH_USER_MODEL, models.PROTECT, related_name='analyst', null=True, blank=True) + analyst = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, related_name='analyst', null=True, blank=True) analyst_signoff_date = models.DateField(null=True, blank=True) - qc_reviewer = models.ForeignKey(settings.AUTH_USER_MODEL, models.PROTECT, + qc_reviewer = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, related_name='qc_reviewer', null=True, blank=True) qc_reviewer_signoff_date = models.DateField(null=True, blank=True) - fws_reviewer = models.ForeignKey(settings.AUTH_USER_MODEL, models.PROTECT, + fws_reviewer = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, related_name='fws_reviewer', null=True, blank=True) fws_reviewer_signoff_date = models.DateField(null=True, blank=True) priority = models.BooleanField(default=False) @@ -181,10 +181,10 @@ def casefile_location(self, instance, filename): name = property(_get_filename) file = models.FileField(upload_to=casefile_location) - case = models.ForeignKey('Case', models.PROTECT, related_name='casefiles') + case = models.ForeignKey('Case', on_delete=models.PROTECT, related_name='casefiles') from_requester = models.BooleanField(default=False) final_letter = models.BooleanField(default=False) - uploader = models.ForeignKey(settings.AUTH_USER_MODEL, models.PROTECT, null=True, blank=True, + uploader = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, null=True, blank=True, related_name="casefiles") uploaded_date = models.DateField(auto_now_add=True, null=True, blank=True) @@ -247,9 +247,8 @@ class CaseTag(HistoryModel): Table to allow many-to-many relationship between Cases and Tags. """ - case = models.ForeignKey('Case', models.CASCADE) - tag = models.ForeignKey('Tag', models.CASCADE) - history = HistoricalRecords() + case = models.ForeignKey('Case', on_delete=models.CASCADE) + tag = models.ForeignKey('Tag', on_delete=models.CASCADE) def __str__(self): return str(self.case) + " - " + str(self.tag) @@ -289,7 +288,7 @@ class Comment(HistoryModel): """ comment = models.TextField() - acase = models.ForeignKey('Case', models.CASCADE, related_name='comments') + acase = models.ForeignKey('Case', on_delete=models.CASCADE, related_name='comments') def __str__(self): return self.comment @@ -331,8 +330,8 @@ class SystemUnit(HistoryModel): system_unit_number = models.CharField(max_length=16, unique=True) system_unit_name = models.CharField(max_length=255, blank=True) - system_unit_type = models.ForeignKey('SystemUnitType', models.PROTECT) - field_office = models.ForeignKey('FieldOffice', models.PROTECT, related_name='system_units', null=True, blank=True) + system_unit_type = models.ForeignKey('SystemUnitType', on_delete=models.PROTECT) + field_office = models.ForeignKey('FieldOffice', on_delete=models.PROTECT, related_name='system_units', null=True, blank=True) system_maps = models.ManyToManyField('SystemMap', through='SystemUnitMap', related_name='system_units') def __str__(self): @@ -364,7 +363,7 @@ class SystemUnitProhibitionDate(HistoryModel): """ prohibition_date = models.DateField() - system_unit = models.ForeignKey('SystemUnit', models.CASCADE, related_name='prohibition_dates') + system_unit = models.ForeignKey('SystemUnit', on_delete=models.CASCADE, related_name='prohibition_dates') def __str__(self): return self.prohibition_date @@ -380,9 +379,8 @@ class SystemUnitMap(HistoryModel): Table to allow many-to-many relationship between System Units and Maps. """ - system_unit = models.ForeignKey('SystemUnit', models.CASCADE) - system_map = models.ForeignKey('SystemMap', models.CASCADE) - history = HistoricalRecords() + system_unit = models.ForeignKey('SystemUnit', on_delete=models.CASCADE) + system_map = models.ForeignKey('SystemMap', on_delete=models.CASCADE) def __str__(self): return str(self.system_unit) + " - " + str(self.system_map) diff --git a/cbrsservices_django/urls.py b/cbrsservices_django/urls.py index 09375b6..6b851da 100644 --- a/cbrsservices_django/urls.py +++ b/cbrsservices_django/urls.py @@ -20,5 +20,5 @@ urlpatterns = [ url('media/(?P.*)$', serve, {'document_root': settings.MEDIA_ROOT, }), - url(r'^cbrsservices/', include(('cbrsservices.urls', 'cbrsservices_django'), namespace="cbrsservices_django")), + url(r'^cbrsservices/', include('cbrsservices.urls')), ]