Skip to content

Commit

Permalink
re-do migrations in order: original models and then historical models
Browse files Browse the repository at this point in the history
  • Loading branch information
Nawaz committed Feb 6, 2024
1 parent f82b579 commit 94dfd7c
Show file tree
Hide file tree
Showing 2 changed files with 293 additions and 277 deletions.
279 changes: 2 additions & 277 deletions report_a_breach/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# Generated by Django 4.2.9 on 2024-02-05 13:49
# Generated by Django 4.2.9 on 2024-02-05 16:40

import uuid

import django.db.models.deletion
import django_countries.fields
import simple_history.models
from django.conf import settings
from django.db import migrations
from django.db import models


class Migration(migrations.Migration):
initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
dependencies = []

operations = [
migrations.CreateModel(
Expand Down Expand Up @@ -185,275 +181,4 @@ class Migration(migrations.Migration):
"abstract": False,
},
),
migrations.CreateModel(
name="HistoricalUploadedDocument",
fields=[
("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
("created_at", models.DateTimeField(blank=True, editable=False)),
("modified_at", models.DateTimeField(blank=True, editable=False)),
("file", models.TextField(max_length=100)),
("history_id", models.AutoField(primary_key=True, serialize=False)),
("history_date", models.DateTimeField(db_index=True)),
("history_change_reason", models.CharField(max_length=100, null=True)),
(
"history_type",
models.CharField(
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], max_length=1
),
),
(
"breach",
models.ForeignKey(
blank=True,
db_constraint=False,
null=True,
on_delete=django.db.models.deletion.DO_NOTHING,
related_name="+",
to="report_a_breach.breach",
),
),
(
"history_user",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"verbose_name": "historical uploaded document",
"verbose_name_plural": "historical uploaded documents",
"ordering": ("-history_date", "-history_id"),
"get_latest_by": ("history_date", "history_id"),
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
migrations.CreateModel(
name="HistoricalSanctionsRegimeBreachThrough",
fields=[
("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
("created_at", models.DateTimeField(blank=True, editable=False)),
("modified_at", models.DateTimeField(blank=True, editable=False)),
("history_id", models.AutoField(primary_key=True, serialize=False)),
("history_date", models.DateTimeField(db_index=True)),
("history_change_reason", models.CharField(max_length=100, null=True)),
(
"history_type",
models.CharField(
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], max_length=1
),
),
(
"breach",
models.ForeignKey(
blank=True,
db_constraint=False,
null=True,
on_delete=django.db.models.deletion.DO_NOTHING,
related_name="+",
to="report_a_breach.breach",
),
),
(
"history_user",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to=settings.AUTH_USER_MODEL,
),
),
(
"sanctions_regime",
models.ForeignKey(
blank=True,
db_constraint=False,
null=True,
on_delete=django.db.models.deletion.DO_NOTHING,
related_name="+",
to="report_a_breach.sanctionsregime",
),
),
],
options={
"verbose_name": "historical sanctions regime breach through",
"verbose_name_plural": "historical sanctions regime breach throughs",
"ordering": ("-history_date", "-history_id"),
"get_latest_by": ("history_date", "history_id"),
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
migrations.CreateModel(
name="HistoricalSanctionsRegime",
fields=[
("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
("created_at", models.DateTimeField(blank=True, editable=False)),
("modified_at", models.DateTimeField(blank=True, editable=False)),
("short_name", models.TextField()),
("full_name", models.TextField()),
("history_id", models.AutoField(primary_key=True, serialize=False)),
("history_date", models.DateTimeField(db_index=True)),
("history_change_reason", models.CharField(max_length=100, null=True)),
(
"history_type",
models.CharField(
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], max_length=1
),
),
(
"history_user",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"verbose_name": "historical sanctions regime",
"verbose_name_plural": "historical sanctions regimes",
"ordering": ("-history_date", "-history_id"),
"get_latest_by": ("history_date", "history_id"),
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
migrations.CreateModel(
name="HistoricalPersonOrCompany",
fields=[
("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
("created_at", models.DateTimeField(blank=True, editable=False)),
("modified_at", models.DateTimeField(blank=True, editable=False)),
(
"person_or_company",
models.CharField(
choices=[("person", "Person"), ("company", "Company")], max_length=7
),
),
("name", models.TextField()),
("website", models.URLField(null=True)),
("address_line_1", models.TextField()),
("address_line_2", models.TextField(null=True)),
("address_line_3", models.TextField(null=True)),
("address_line_4", models.TextField(null=True)),
("town_or_city", models.TextField()),
("county", django_countries.fields.CountryField(max_length=2)),
("postcode", models.TextField()),
(
"type_of_relationship",
models.CharField(
choices=[
("breacher", "Breacher"),
("supplier", "Supplier"),
("recipient", "Recipient"),
],
max_length=9,
),
),
("history_id", models.AutoField(primary_key=True, serialize=False)),
("history_date", models.DateTimeField(db_index=True)),
("history_change_reason", models.CharField(max_length=100, null=True)),
(
"history_type",
models.CharField(
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], max_length=1
),
),
(
"breach",
models.ForeignKey(
blank=True,
db_constraint=False,
null=True,
on_delete=django.db.models.deletion.DO_NOTHING,
related_name="+",
to="report_a_breach.breach",
),
),
(
"history_user",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"verbose_name": "historical person or company",
"verbose_name_plural": "historical person or companys",
"ordering": ("-history_date", "-history_id"),
"get_latest_by": ("history_date", "history_id"),
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
migrations.CreateModel(
name="HistoricalBreach",
fields=[
("id", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
("created_at", models.DateTimeField(blank=True, editable=False)),
("modified_at", models.DateTimeField(blank=True, editable=False)),
(
"reporter_professional_relationship",
models.TextField(
choices=[
(
"owner",
"I'm an owner, officer or employee of the company, or I am the person",
),
(
"acting",
"I do not work for the company, but I'm acting on their behalf to make a voluntary declaration",
),
(
"third_party",
"I work for a third party with a legal responsibility to make a mandatory declaration",
),
(
"no_professional_relationship",
"I do not have a professional relationship with the company or person or I no longer have a professional relationship with them",
),
],
verbose_name="What is the professional relationship with the company or person suspected of breaching sanctions?",
),
),
(
"reporter_email_address",
models.EmailField(max_length=254, verbose_name="What is your email address?"),
),
("reporter_full_name", models.TextField(verbose_name="What is your full name?")),
(
"additional_information",
models.TextField(verbose_name="Tell us about the suspected breach"),
),
("history_id", models.AutoField(primary_key=True, serialize=False)),
("history_date", models.DateTimeField(db_index=True)),
("history_change_reason", models.CharField(max_length=100, null=True)),
(
"history_type",
models.CharField(
choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")], max_length=1
),
),
(
"history_user",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"verbose_name": "historical breach",
"verbose_name_plural": "historical breachs",
"ordering": ("-history_date", "-history_id"),
"get_latest_by": ("history_date", "history_id"),
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
]
Loading

0 comments on commit 94dfd7c

Please sign in to comment.