text: # Generated by Django 2.0.4 on 2018-05-15 02:06
  
  from django.conf import settings
  import django.contrib.gis.db.models.fields
  import django.core.validators
  from django.db import migrations, models
  import django.db.models.deletion
  import django.utils.timezone
  import taggit.managers
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
          migrations.swappable_dependency(settings.AUTH_USER_MODEL),
          ('taggit', '0002_auto_20150616_2121'),
      ]
  
      operations = [
          migrations.CreateModel(
              name='Agency',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('code', models.CharField(max_length=16)),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_agency_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_agency_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['name'],
                  'verbose_name_plural': 'agencies',
              },
          ),
          migrations.CreateModel(
              name='Bookmark',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('description', models.CharField(blank=True, help_text='Maximum 200 characters.', max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_bookmark_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_bookmark_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['-created'],
              },
          ),
          migrations.CreateModel(
              name='Clearance',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('date_created', models.DateField(auto_now_add=True)),
                  ('deposited_plan', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
              ],
          ),
          migrations.CreateModel(
              name='Condition',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('condition', models.TextField(blank=True, editable=False, null=True)),
                  ('condition_html', models.TextField(blank=True, help_text="Insert words exactly as in the decision-maker's letter\n        of approval, and add any advice notes relating to DPaW.", null=True, verbose_name='approved condition')),
                  ('proposed_condition', models.TextField(blank=True, editable=False, null=True)),
                  ('proposed_condition_html', models.TextField(blank=True, help_text='Condition text proposed by DPaW.', null=True, verbose_name='proposed condition')),
                  ('identifier', models.CharField(blank=True, help_text="The decision-making authority's identifying number or code for this condition.", max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)])),
              ],
              options={
                  'abstract': False,
                  'ordering': ['-created'],
              },
          ),
          migrations.CreateModel(
              name='ConditionCategory',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_conditioncategory_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_conditioncategory_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['name'],
                  'verbose_name_plural': 'condition categories',
              },
          ),
          migrations.CreateModel(
              name='DopTrigger',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_doptrigger_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_doptrigger_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'verbose_name': 'DoP trigger',
                  'ordering': ['name'],
              },
          ),
          migrations.CreateModel(
              name='LocalGovernment',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_localgovernment_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_localgovernment_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['name'],
              },
          ),
          migrations.CreateModel(
              name='Location',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('address_no', models.IntegerField(blank=True, null=True, verbose_name='address number')),
                  ('address_suffix', models.CharField(blank=True, max_length=10, null=True, validators=[django.core.validators.MaxLengthValidator(10)])),
                  ('road_name', models.CharField(blank=True, max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)])),
                  ('road_suffix', models.CharField(blank=True, max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)])),
                  ('locality', models.CharField(blank=True, max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)])),
                  ('postcode', models.CharField(blank=True, max_length=6, null=True, validators=[django.core.validators.MaxLengthValidator(6)])),
                  ('landuse', models.TextField(blank=True, null=True)),
                  ('lot_no', models.CharField(blank=True, max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)], verbose_name='lot number')),
                  ('lot_desc', models.TextField(blank=True, null=True)),
                  ('strata_lot_no', models.CharField(blank=True, max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)])),
                  ('strata_lot_desc', models.TextField(blank=True, null=True)),
                  ('reserve', models.TextField(blank=True, null=True)),
                  ('cadastre_obj_id', models.IntegerField(blank=True, null=True)),
                  ('poly', django.contrib.gis.db.models.fields.PolygonField(blank=True, help_text='Optional.', null=True, srid=4283)),
                  ('address_string', models.TextField(blank=True, null=True)),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_location_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_location_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['-created'],
              },
          ),
          migrations.CreateModel(
              name='ModelCondition',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('condition', models.TextField(help_text='Model condition')),
                  ('identifier', models.CharField(blank=True, help_text="The decision-making authority's identifying number or code for this condition.", max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)])),
                  ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='referral.ConditionCategory')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_modelcondition_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_modelcondition_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['-created'],
              },
          ),
          migrations.CreateModel(
              name='Note',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('note_html', models.TextField(verbose_name='note')),
                  ('note', models.TextField(editable=False)),
                  ('order_date', models.DateField(blank=True, help_text='Optional date (for sorting purposes).', null=True, verbose_name='date')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_note_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_note_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'ordering': ['order_date'],
              },
          ),
          migrations.CreateModel(
              name='NoteType',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('icon', models.ImageField(blank=True, null=True, upload_to='img')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_notetype_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_notetype_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['name'],
              },
          ),
          migrations.CreateModel(
              name='Organisation',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('list_name', models.CharField(help_text='Name as it will appear in the alphabetised selection lists (e.g. "Broome,\n            Shire of"). Put acronyms (e.g. OEPA) at the end.', max_length=100, validators=[django.core.validators.MaxLengthValidator(100)])),
                  ('telephone', models.CharField(blank=True, help_text='Include the area code.', max_length=20, null=True)),
                  ('fax', models.CharField(blank=True, help_text='Include the area code.', max_length=20, null=True, validators=[django.core.validators.MaxLengthValidator(20)])),
                  ('email', models.EmailField(blank=True, max_length=254, null=True)),
                  ('address1', models.CharField(blank=True, help_text='Postal address (optional). Maximum 100 characters.', max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)], verbose_name='Address line 1')),
                  ('address2', models.CharField(blank=True, help_text='Postal address line 2 (optional). Maximum 100 characters.', max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)], verbose_name='Address line 2')),
                  ('suburb', models.CharField(blank=True, max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)])),
                  ('state', models.IntegerField(choices=[(1, 'ACT'), (2, 'NSW'), (3, 'NT'), (4, 'QLD'), (5, 'SA'), (6, 'TAS'), (7, 'VIC'), (8, 'WA')], default=8)),
                  ('postcode', models.CharField(blank=True, max_length=4, null=True, validators=[django.core.validators.MaxLengthValidator(4)])),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_organisation_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_organisation_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['name'],
              },
          ),
          migrations.CreateModel(
              name='OrganisationType',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_organisationtype_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_organisationtype_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['name'],
              },
          ),
          migrations.CreateModel(
              name='Record',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(help_text='The name/description of the record (max 512 characters).', max_length=512, validators=[django.core.validators.MaxLengthValidator(512)])),
                  ('uploaded_file', models.FileField(blank=True, help_text='Allowed file types: TIF,JPG,GIF,PNG,DOC,DOCX,XLS,XLSX,CSV,PDF,TXT,ZIP,MSG,QGS,XML', max_length=255, null=True, upload_to='uploads/%Y/%m/%d')),
                  ('infobase_id', models.SlugField(blank=True, help_text='Infobase object ID (optional).', null=True, verbose_name='Infobase ID')),
                  ('description', models.TextField(blank=True, null=True)),
                  ('order_date', models.DateField(blank=True, help_text='Optional date (for sorting purposes).', null=True, verbose_name='date')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_record_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_record_modified', to=settings.AUTH_USER_MODEL)),
                  ('notes', models.ManyToManyField(blank=True, to='referral.Note')),
              ],
              options={
                  'abstract': False,
                  'ordering': ['-created'],
              },
          ),
          migrations.CreateModel(
              name='Referral',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('reference', models.CharField(help_text="[Searchable] Referrer's reference no. Maximum 100 characters.", max_length=100, validators=[django.core.validators.MaxLengthValidator(100)])),
                  ('file_no', models.CharField(blank=True, help_text='[Searchable] The DPaW file this referral is filed within. Maximum 100 characters.', max_length=100, null=True, validators=[django.core.validators.MaxLengthValidator(100)])),
                  ('description', models.TextField(blank=True, help_text='[Searchable] Optional.', null=True)),
                  ('referral_date', models.DateField(help_text='Date that the referral was received.', verbose_name='received date')),
                  ('address', models.CharField(blank=True, help_text='[Searchable] Physical address of the planning proposal. Maximum 200 characters.', max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('point', django.contrib.gis.db.models.fields.PointField(blank=True, editable=False, help_text='Optional.', null=True, srid=4283)),
                  ('agency', models.ForeignKey(blank=True, help_text='[Searchable] The agency to which this referral relates.', null=True, on_delete=django.db.models.deletion.PROTECT, to='referral.Agency')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_referral_created', to=settings.AUTH_USER_MODEL)),
                  ('dop_triggers', models.ManyToManyField(blank=True, help_text='[Searchable] The Department of Planning trigger(s) for this referral.', related_name='dop_triggers', to='referral.DopTrigger', verbose_name='DoP triggers')),
                  ('lga', models.ForeignKey(blank=True, help_text='[Searchable] The LGA in which this referral resides.', null=True, on_delete=django.db.models.deletion.PROTECT, to='referral.LocalGovernment', verbose_name='local government')),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_referral_modified', to=settings.AUTH_USER_MODEL)),
                  ('referring_org', models.ForeignKey(help_text='[Searchable] The referring organisation or individual.', on_delete=django.db.models.deletion.PROTECT, to='referral.Organisation', verbose_name='referring organisation')),
              ],
              options={
                  'abstract': False,
                  'ordering': ['-created'],
              },
          ),
          migrations.CreateModel(
              name='ReferralType',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_referraltype_created', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['name'],
              },
          ),
          migrations.CreateModel(
              name='Region',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('region_mpoly', django.contrib.gis.db.models.fields.MultiPolygonField(blank=True, help_text='Optional.', null=True, srid=4283)),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_region_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_region_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['name'],
              },
          ),
          migrations.CreateModel(
              name='RelatedReferral',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('from_referral', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='from_referral', to='referral.Referral')),
                  ('to_referral', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='to_referral', to='referral.Referral')),
              ],
          ),
          migrations.CreateModel(
              name='Task',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('description', models.TextField(blank=True, help_text='Description of the task requirements.', null=True)),
                  ('start_date', models.DateField(blank=True, help_text='Date on which this task was started.', null=True)),
                  ('due_date', models.DateField(blank=True, help_text='Date by which the task must be completed.', null=True)),
                  ('complete_date', models.DateField(blank=True, help_text='Date that the task was completed.', null=True, verbose_name='completed date')),
                  ('stop_date', models.DateField(blank=True, help_text='Date that the task was stopped.', null=True)),
                  ('restart_date', models.DateField(blank=True, help_text='Date that a stopped task was restarted.', null=True)),
                  ('stop_time', models.IntegerField(default=0, editable=False, help_text='Cumulative time stopped in days.')),
                  ('assigned_user', models.ForeignKey(help_text='The officer responsible for completing the task.', on_delete=django.db.models.deletion.PROTECT, related_name='refer_task_assigned_user', to=settings.AUTH_USER_MODEL)),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_task_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_task_modified', to=settings.AUTH_USER_MODEL)),
                  ('notes', models.ManyToManyField(blank=True, to='referral.Note')),
                  ('records', models.ManyToManyField(blank=True, to='referral.Record')),
                  ('referral', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='referral.Referral')),
              ],
              options={
                  'ordering': ['-pk', 'due_date'],
              },
          ),
          migrations.CreateModel(
              name='TaskState',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('is_ongoing', models.BooleanField(default=True, help_text='Does this task state indicate that the task remains active?')),
                  ('is_assessment', models.BooleanField(default=False, help_text='Does this task state represent an assessment by staff?')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_taskstate_created', to=settings.AUTH_USER_MODEL)),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_taskstate_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['name'],
              },
          ),
          migrations.CreateModel(
              name='TaskType',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('modified', models.DateTimeField(auto_now=True)),
                  ('effective_to', models.DateTimeField(blank=True, null=True)),
                  ('name', models.CharField(max_length=200)),
                  ('description', models.CharField(blank=True, max_length=200, null=True, validators=[django.core.validators.MaxLengthValidator(200)])),
                  ('slug', models.SlugField(help_text='Must be unique. Automatically generated from name.', unique=True)),
                  ('public', models.BooleanField(default=True, help_text='Is this lookup selection available to all users?')),
                  ('target_days', models.IntegerField(default=35, help_text='Time limit to fall back on if there is no user-supplied due date.')),
                  ('creator', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_tasktype_created', to=settings.AUTH_USER_MODEL)),
                  ('initial_state', models.ForeignKey(help_text='The initial state for this task type.', limit_choices_to=models.Q(effective_to__isnull=True), on_delete=django.db.models.deletion.PROTECT, to='referral.TaskState')),
                  ('modifier', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_tasktype_modified', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'abstract': False,
                  'ordering': ['name'],
              },
          ),
          migrations.CreateModel(
              name='UserProfile',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('referral_history', models.TextField(blank=True, null=True)),
                  ('task_history', models.TextField(blank=True, null=True)),
                  ('agency', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='referral.Agency')),
                  ('user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
              ],
          ),
          migrations.AddField(
              model_name='taskstate',
              name='task_type',
              field=models.ForeignKey(blank=True, help_text='Optional - does this state relate to a single task type only?', null=True, on_delete=django.db.models.deletion.PROTECT, to='referral.TaskType'),
          ),
          migrations.AddField(
              model_name='task',
              name='state',
              field=models.ForeignKey(help_text='The status of the task.', on_delete=django.db.models.deletion.PROTECT, to='referral.TaskState', verbose_name='status'),
          ),
          migrations.AddField(
              model_name='task',
              name='type',
              field=models.ForeignKey(help_text='The task type.', on_delete=django.db.models.deletion.PROTECT, to='referral.TaskType', verbose_name='task type'),
          ),
          migrations.AddField(
              model_name='referraltype',
              name='initial_task',
              field=models.ForeignKey(blank=True, help_text='Optional, but highly recommended.', limit_choices_to=models.Q(effective_to__isnull=True), null=True, on_delete=django.db.models.deletion.PROTECT, to='referral.TaskType'),
          ),
          migrations.AddField(
              model_name='referraltype',
              name='modifier',
              field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_referraltype_modified', to=settings.AUTH_USER_MODEL),
          ),
          migrations.AddField(
              model_name='referral',
              name='regions',
              field=models.ManyToManyField(blank=True, help_text='[Searchable] The region(s) in which this referral belongs.', related_name='regions', to='referral.Region'),
          ),
          migrations.AddField(
              model_name='referral',
              name='related_refs',
              field=models.ManyToManyField(editable=False, related_name='related_referrals', through='referral.RelatedReferral', to='referral.Referral'),
          ),
          migrations.AddField(
              model_name='referral',
              name='tags',
              field=taggit.managers.TaggableManager(blank=True, help_text='[Searchable] A list of issues or tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Issues/tags'),
          ),
          migrations.AddField(
              model_name='referral',
              name='type',
              field=models.ForeignKey(help_text='[Searchable] The referral type; explanation of these categories is also found\n            in the <a href="/help/">PRS User documentation</a>.', on_delete=django.db.models.deletion.PROTECT, to='referral.ReferralType', verbose_name='referral type'),
          ),
          migrations.AddField(
              model_name='record',
              name='referral',
              field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='referral.Referral'),
          ),
          migrations.AddField(
              model_name='organisation',
              name='type',
              field=models.ForeignKey(help_text='The organisation type.', on_delete=django.db.models.deletion.PROTECT, to='referral.OrganisationType'),
          ),
          migrations.AddField(
              model_name='note',
              name='records',
              field=models.ManyToManyField(blank=True, to='referral.Record'),
          ),
          migrations.AddField(
              model_name='note',
              name='referral',
              field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='referral.Referral'),
          ),
          migrations.AddField(
              model_name='note',
              name='type',
              field=models.ForeignKey(blank=True, help_text='The type of note (optional).', null=True, on_delete=django.db.models.deletion.PROTECT, to='referral.NoteType', verbose_name='note type'),
          ),
          migrations.AddField(
              model_name='location',
              name='referral',
              field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='referral.Referral'),
          ),
          migrations.AddField(
              model_name='condition',
              name='category',
              field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='referral.ConditionCategory'),
          ),
          migrations.AddField(
              model_name='condition',
              name='clearance_tasks',
              field=models.ManyToManyField(editable=False, related_name='clearance_requests', through='referral.Clearance', to='referral.Task'),
          ),
          migrations.AddField(
              model_name='condition',
              name='creator',
              field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_condition_created', to=settings.AUTH_USER_MODEL),
          ),
          migrations.AddField(
              model_name='condition',
              name='model_condition',
              field=models.ForeignKey(blank=True, help_text='Model text on which this condition is based', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='model_condition', to='referral.ModelCondition'),
          ),
          migrations.AddField(
              model_name='condition',
              name='modifier',
              field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.PROTECT, related_name='referral_condition_modified', to=settings.AUTH_USER_MODEL),
          ),
          migrations.AddField(
              model_name='condition',
              name='referral',
              field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='referral.Referral'),
          ),
          migrations.AddField(
              model_name='condition',
              name='tags',
              field=taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
          ),
          migrations.AddField(
              model_name='clearance',
              name='condition',
              field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='referral.Condition'),
          ),
          migrations.AddField(
              model_name='clearance',
              name='task',
              field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='referral.Task'),
          ),
          migrations.AddField(
              model_name='bookmark',
              name='referral',
              field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='referral.Referral'),
          ),
          migrations.AddField(
              model_name='bookmark',
              name='user',
              field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='referral_user_bookmark', to=settings.AUTH_USER_MODEL),
          ),
      ]
  