summaryrefslogtreecommitdiffstats
path: root/engagements/migrations
diff options
context:
space:
mode:
authorYulqen <246857+yulqen@users.noreply.github.com>2024-09-10 15:58:55 +0100
committerGitHub <noreply@github.com>2024-09-10 15:58:55 +0100
commitdcfe6d87098bbe064d2db268f0972865c3d412bf (patch)
tree2b82df07a5290f80f25e9780596cbce0f128454f /engagements/migrations
parent7ddc22b821f405546786977225e7b194a19b2b77 (diff)
parent15b2dc965bfe2271d73476fcf9ff636c60113908 (diff)
Merge pull request #106 from defencedigital/postgres-migration
Adds new Engagement Strategy stuff
Diffstat (limited to '')
-rw-r--r--engagements/migrations/0004_regulatorycycle_alter_engagementeffort_effort_type.py42
-rw-r--r--engagements/migrations/0005_engagementstrategy.py62
-rw-r--r--engagements/migrations/0006_engagementstrategy_owned_by_and_more.py38
-rw-r--r--engagements/migrations/0007_alter_engagementstrategy_reviewed_by.py27
-rw-r--r--engagements/migrations/0008_alter_engagementstrategy_options_and_more.py21
-rw-r--r--engagements/migrations/0009_alter_engagementstrategy_description.py18
-rw-r--r--engagements/migrations/0010_remove_engagementstrategy_name.py17
7 files changed, 225 insertions, 0 deletions
diff --git a/engagements/migrations/0004_regulatorycycle_alter_engagementeffort_effort_type.py b/engagements/migrations/0004_regulatorycycle_alter_engagementeffort_effort_type.py
new file mode 100644
index 0000000..00d9db6
--- /dev/null
+++ b/engagements/migrations/0004_regulatorycycle_alter_engagementeffort_effort_type.py
@@ -0,0 +1,42 @@
+# Generated by Django 5.0.4 on 2024-09-10 10:27
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("engagements", "0003_engagementeffort_notes"),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name="RegulatoryCycle",
+ fields=[
+ ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
+ ("date_created", models.DateTimeField(auto_now_add=True)),
+ ("last_modified", models.DateTimeField(auto_now=True)),
+ ("start_date", models.DateField()),
+ ("end_date", models.DateField()),
+ ("description", models.TextField(blank=True, max_length=1024, null=True)),
+ ],
+ options={
+ "abstract": False,
+ },
+ ),
+ migrations.AlterField(
+ model_name="engagementeffort",
+ name="effort_type",
+ field=models.CharField(
+ choices=[
+ ("TRAVEL", "Travel"),
+ ("PLANNING", "Planning"),
+ ("REGULATION", "Regulation (On-site or Remote)"),
+ ("DISCUSSION", "Discussion"),
+ ("REPORTING", "Reporting"),
+ ],
+ max_length=32,
+ verbose_name="Effort Type",
+ ),
+ ),
+ ]
diff --git a/engagements/migrations/0005_engagementstrategy.py b/engagements/migrations/0005_engagementstrategy.py
new file mode 100644
index 0000000..213499d
--- /dev/null
+++ b/engagements/migrations/0005_engagementstrategy.py
@@ -0,0 +1,62 @@
+# Generated by Django 5.0.4 on 2024-09-10 11:24
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("engagements", "0004_regulatorycycle_alter_engagementeffort_effort_type"),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name="EngagementStrategy",
+ fields=[
+ ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
+ ("date_created", models.DateTimeField(auto_now_add=True)),
+ ("last_modified", models.DateTimeField(auto_now=True)),
+ ("name", models.CharField(max_length=128)),
+ ("description", models.TextField(max_length=1024)),
+ ("inspector_sign_off", models.DateField(blank=True, null=True)),
+ ("management_sign_off", models.DateField(blank=True, null=True)),
+ (
+ "status",
+ models.CharField(
+ choices=[
+ ("DRAFT", "Draft"),
+ ("SUBMITTED", "Submitted"),
+ ("APPROVED", "Approved"),
+ ("REJECTED", "Rejected"),
+ ],
+ default="DRAFT",
+ max_length=32,
+ ),
+ ),
+ (
+ "end_year",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="end_year",
+ to="engagements.regulatorycycle",
+ ),
+ ),
+ (
+ "organisation",
+ models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="engagements.organisation"),
+ ),
+ (
+ "start_year",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="start_year",
+ to="engagements.regulatorycycle",
+ ),
+ ),
+ ],
+ options={
+ "abstract": False,
+ },
+ ),
+ ]
diff --git a/engagements/migrations/0006_engagementstrategy_owned_by_and_more.py b/engagements/migrations/0006_engagementstrategy_owned_by_and_more.py
new file mode 100644
index 0000000..8b0a509
--- /dev/null
+++ b/engagements/migrations/0006_engagementstrategy_owned_by_and_more.py
@@ -0,0 +1,38 @@
+# Generated by Django 5.0.4 on 2024-09-10 12:33
+
+import django.db.models.deletion
+from django.conf import settings
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("engagements", "0005_engagementstrategy"),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="engagementstrategy",
+ name="owned_by",
+ field=models.ForeignKey(
+ default=1,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="owned_engagement_strategies",
+ to=settings.AUTH_USER_MODEL,
+ ),
+ preserve_default=False,
+ ),
+ migrations.AddField(
+ model_name="engagementstrategy",
+ name="reviewed_by",
+ field=models.ForeignKey(
+ default=1,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="reviewed_engagement_strategies",
+ to=settings.AUTH_USER_MODEL,
+ ),
+ preserve_default=False,
+ ),
+ ]
diff --git a/engagements/migrations/0007_alter_engagementstrategy_reviewed_by.py b/engagements/migrations/0007_alter_engagementstrategy_reviewed_by.py
new file mode 100644
index 0000000..cacae95
--- /dev/null
+++ b/engagements/migrations/0007_alter_engagementstrategy_reviewed_by.py
@@ -0,0 +1,27 @@
+# Generated by Django 5.0.4 on 2024-09-10 12:45
+
+import django.db.models.deletion
+from django.conf import settings
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("engagements", "0006_engagementstrategy_owned_by_and_more"),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="engagementstrategy",
+ name="reviewed_by",
+ field=models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="reviewed_engagement_strategies",
+ to=settings.AUTH_USER_MODEL,
+ ),
+ ),
+ ]
diff --git a/engagements/migrations/0008_alter_engagementstrategy_options_and_more.py b/engagements/migrations/0008_alter_engagementstrategy_options_and_more.py
new file mode 100644
index 0000000..c9b7a50
--- /dev/null
+++ b/engagements/migrations/0008_alter_engagementstrategy_options_and_more.py
@@ -0,0 +1,21 @@
+# Generated by Django 5.0.4 on 2024-09-10 12:49
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("engagements", "0007_alter_engagementstrategy_reviewed_by"),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name="engagementstrategy",
+ options={"ordering": ("start_year",), "verbose_name_plural": "Engagement Strategies"},
+ ),
+ migrations.AlterUniqueTogether(
+ name="engagementstrategy",
+ unique_together={("start_year", "organisation")},
+ ),
+ ]
diff --git a/engagements/migrations/0009_alter_engagementstrategy_description.py b/engagements/migrations/0009_alter_engagementstrategy_description.py
new file mode 100644
index 0000000..8fc9511
--- /dev/null
+++ b/engagements/migrations/0009_alter_engagementstrategy_description.py
@@ -0,0 +1,18 @@
+# Generated by Django 5.0.4 on 2024-09-10 12:51
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("engagements", "0008_alter_engagementstrategy_options_and_more"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="engagementstrategy",
+ name="description",
+ field=models.TextField(blank=True, max_length=1024, null=True),
+ ),
+ ]
diff --git a/engagements/migrations/0010_remove_engagementstrategy_name.py b/engagements/migrations/0010_remove_engagementstrategy_name.py
new file mode 100644
index 0000000..45aa795
--- /dev/null
+++ b/engagements/migrations/0010_remove_engagementstrategy_name.py
@@ -0,0 +1,17 @@
+# Generated by Django 5.0.4 on 2024-09-10 13:07
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("engagements", "0009_alter_engagementstrategy_description"),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name="engagementstrategy",
+ name="name",
+ ),
+ ]