diff --git a/backend/core/migrations/0025_requirementassessment_answer_and_more.py b/backend/core/migrations/0026_requirementassessment_answer_and_more.py similarity index 51% rename from backend/core/migrations/0025_requirementassessment_answer_and_more.py rename to backend/core/migrations/0026_requirementassessment_answer_and_more.py index 1cee730e6..3179ff5a9 100644 --- a/backend/core/migrations/0025_requirementassessment_answer_and_more.py +++ b/backend/core/migrations/0026_requirementassessment_answer_and_more.py @@ -1,22 +1,23 @@ -# Generated by Django 5.1 on 2024-09-04 13:56 +# Generated by Django 5.1.1 on 2024-09-13 15:42 from django.db import migrations, models class Migration(migrations.Migration): + dependencies = [ - ("core", "0024_appliedcontrol_owner"), + ('core', '0025_complianceassessment_folder_riskassessment_folder_and_more'), ] operations = [ migrations.AddField( - model_name="requirementassessment", - name="answer", - field=models.JSONField(blank=True, null=True, verbose_name="Answer"), + model_name='requirementassessment', + name='answer', + field=models.JSONField(blank=True, null=True, verbose_name='Answer'), ), migrations.AddField( - model_name="requirementnode", - name="question", - field=models.JSONField(blank=True, null=True, verbose_name="Question"), + model_name='requirementnode', + name='question', + field=models.JSONField(blank=True, null=True, verbose_name='Question'), ), ] diff --git a/backend/iam/migrations/0006_alter_folder_content_type.py b/backend/iam/migrations/0006_alter_folder_content_type.py deleted file mode 100644 index b9c2dc23f..000000000 --- a/backend/iam/migrations/0006_alter_folder_content_type.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 5.1.1 on 2024-09-12 17:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("iam", "0005_alter_user_managers"), - ] - - operations = [ - migrations.AlterField( - model_name="folder", - name="content_type", - field=models.CharField( - choices=[("GL", "GLOBAL"), ("DO", "DOMAIN"), ("EN", "ENCLAVE")], - default="DO", - max_length=2, - ), - ), - ] diff --git a/backend/iam/migrations/0007_alter_folder_content_type.py b/backend/iam/migrations/0007_alter_folder_content_type.py new file mode 100644 index 000000000..a0c0b120b --- /dev/null +++ b/backend/iam/migrations/0007_alter_folder_content_type.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-13 15:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('iam', '0006_alter_role_folder_alter_roleassignment_folder_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='folder', + name='content_type', + field=models.CharField(choices=[('GL', 'GLOBAL'), ('DO', 'DOMAIN'), ('EN', 'ENCLAVE')], default='DO', max_length=2), + ), + ] diff --git a/backend/tprm/migrations/0001_initial.py b/backend/tprm/migrations/0001_initial.py index abf9ab7bf..8665098dc 100644 --- a/backend/tprm/migrations/0001_initial.py +++ b/backend/tprm/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.1 on 2024-09-13 08:30 +# Generated by Django 5.1.1 on 2024-09-13 15:42 import django.db.models.deletion import iam.models @@ -8,314 +8,105 @@ class Migration(migrations.Migration): + initial = True dependencies = [ - ("core", "0025_requirementassessment_answer_and_more"), - ("iam", "0006_alter_folder_content_type"), + ('core', '0026_requirementassessment_answer_and_more'), + ('iam', '0007_alter_folder_content_type'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( - name="Entity", + name='Entity', fields=[ - ( - "id", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ( - "created_at", - models.DateTimeField(auto_now_add=True, verbose_name="Created at"), - ), - ( - "updated_at", - models.DateTimeField(auto_now=True, verbose_name="Updated at"), - ), - ( - "is_published", - models.BooleanField(default=False, verbose_name="published"), - ), - ("name", models.CharField(max_length=200, verbose_name="Name")), - ( - "description", - models.TextField(blank=True, null=True, verbose_name="Description"), - ), - ("mission", models.TextField(blank=True)), - ("reference_link", models.URLField(blank=True, null=True)), - ("builtin", models.BooleanField(default=False)), - ( - "folder", - models.ForeignKey( - default=iam.models.Folder.get_root_folder, - on_delete=django.db.models.deletion.CASCADE, - related_name="%(class)s_folder", - to="iam.folder", - ), - ), - ( - "owned_folders", - models.ManyToManyField( - blank=True, - related_name="owner", - to="iam.folder", - verbose_name="Owned folders", - ), - ), + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')), + ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')), + ('is_published', models.BooleanField(default=False, verbose_name='published')), + ('name', models.CharField(max_length=200, verbose_name='Name')), + ('description', models.TextField(blank=True, null=True, verbose_name='Description')), + ('mission', models.TextField(blank=True)), + ('reference_link', models.URLField(blank=True, null=True)), + ('builtin', models.BooleanField(default=False)), + ('folder', models.ForeignKey(default=iam.models.Folder.get_root_folder_id, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_folder', to='iam.folder')), + ('owned_folders', models.ManyToManyField(blank=True, related_name='owner', to='iam.folder', verbose_name='Owned folders')), ], options={ - "verbose_name": "Entity", - "verbose_name_plural": "Entities", + 'verbose_name': 'Entity', + 'verbose_name_plural': 'Entities', }, ), migrations.CreateModel( - name="Representative", + name='Representative', fields=[ - ( - "id", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ( - "created_at", - models.DateTimeField(auto_now_add=True, verbose_name="Created at"), - ), - ( - "updated_at", - models.DateTimeField(auto_now=True, verbose_name="Updated at"), - ), - ( - "is_published", - models.BooleanField(default=False, verbose_name="published"), - ), - ("email", models.EmailField(max_length=254, unique=True)), - ("first_name", models.CharField(blank=True, max_length=255)), - ("last_name", models.CharField(blank=True, max_length=255)), - ("phone", models.CharField(blank=True, max_length=255)), - ("role", models.CharField(blank=True, max_length=255)), - ("description", models.TextField(blank=True)), - ( - "entity", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="representatives", - to="tprm.entity", - verbose_name="Entity", - ), - ), + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')), + ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')), + ('is_published', models.BooleanField(default=False, verbose_name='published')), + ('email', models.EmailField(max_length=254, unique=True)), + ('first_name', models.CharField(blank=True, max_length=255)), + ('last_name', models.CharField(blank=True, max_length=255)), + ('phone', models.CharField(blank=True, max_length=255)), + ('role', models.CharField(blank=True, max_length=255)), + ('description', models.TextField(blank=True)), + ('entity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='representatives', to='tprm.entity', verbose_name='Entity')), + ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ], options={ - "abstract": False, + 'abstract': False, }, ), migrations.CreateModel( - name="Solution", + name='Solution', fields=[ - ( - "id", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ( - "created_at", - models.DateTimeField(auto_now_add=True, verbose_name="Created at"), - ), - ( - "updated_at", - models.DateTimeField(auto_now=True, verbose_name="Updated at"), - ), - ( - "is_published", - models.BooleanField(default=False, verbose_name="published"), - ), - ("name", models.CharField(max_length=200, verbose_name="Name")), - ( - "description", - models.TextField(blank=True, null=True, verbose_name="Description"), - ), - ("ref_id", models.CharField(blank=True, max_length=255)), - ( - "criticality", - models.IntegerField(default=0, verbose_name="Criticality"), - ), - ( - "provider_entity", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="provided_solutions", - to="tprm.entity", - verbose_name="Provider entity", - ), - ), - ( - "recipient_entity", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="received_solutions", - to="tprm.entity", - verbose_name="Recipient entity", - ), - ), + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')), + ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')), + ('is_published', models.BooleanField(default=False, verbose_name='published')), + ('name', models.CharField(max_length=200, verbose_name='Name')), + ('description', models.TextField(blank=True, null=True, verbose_name='Description')), + ('ref_id', models.CharField(blank=True, max_length=255)), + ('criticality', models.IntegerField(default=0, verbose_name='Criticality')), + ('provider_entity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='provided_solutions', to='tprm.entity', verbose_name='Provider entity')), + ('recipient_entity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='received_solutions', to='tprm.entity', verbose_name='Recipient entity')), ], options={ - "verbose_name": "Solution", - "verbose_name_plural": "Solutions", + 'verbose_name': 'Solution', + 'verbose_name_plural': 'Solutions', }, ), migrations.CreateModel( - name="EntityAssessment", + name='EntityAssessment', fields=[ - ( - "id", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ( - "created_at", - models.DateTimeField(auto_now_add=True, verbose_name="Created at"), - ), - ( - "updated_at", - models.DateTimeField(auto_now=True, verbose_name="Updated at"), - ), - ( - "is_published", - models.BooleanField(default=False, verbose_name="published"), - ), - ("name", models.CharField(max_length=200, verbose_name="Name")), - ( - "description", - models.TextField(blank=True, null=True, verbose_name="Description"), - ), - ("eta", models.DateField(blank=True, null=True, verbose_name="ETA")), - ( - "due_date", - models.DateField(blank=True, null=True, verbose_name="Due date"), - ), - ( - "version", - models.CharField( - blank=True, - default="1.0", - help_text="Version of the compliance assessment (eg. 1.0, 2.0, etc.)", - max_length=100, - null=True, - verbose_name="Version", - ), - ), - ( - "status", - models.CharField( - blank=True, - choices=[ - ("planned", "Planned"), - ("in_progress", "In progress"), - ("in_review", "In review"), - ("done", "Done"), - ("deprecated", "Deprecated"), - ], - default="planned", - max_length=100, - null=True, - verbose_name="Status", - ), - ), - ( - "criticality", - models.IntegerField(default=0, verbose_name="Criticality"), - ), - ( - "penetration", - models.IntegerField(default=0, verbose_name="Penetration"), - ), - ( - "dependency", - models.IntegerField(default=0, verbose_name="Dependency"), - ), - ("maturity", models.IntegerField(default=0, verbose_name="Maturity")), - ("trust", models.IntegerField(default=0, verbose_name="Trust")), - ( - "authors", - models.ManyToManyField( - blank=True, - related_name="%(class)s_authors", - to=settings.AUTH_USER_MODEL, - verbose_name="Authors", - ), - ), - ( - "compliance_assessment", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="core.complianceassessment", - ), - ), - ( - "entity", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="tprm.entity" - ), - ), - ( - "evidence", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="core.evidence", - ), - ), - ( - "project", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="core.project", - verbose_name="Project", - ), - ), - ( - "reviewers", - models.ManyToManyField( - blank=True, - related_name="%(class)s_reviewers", - to=settings.AUTH_USER_MODEL, - verbose_name="Reviewers", - ), - ), - ( - "solutions", - models.ManyToManyField( - blank=True, - related_name="entity_assessments", - to="tprm.solution", - verbose_name="Solutions", - ), - ), + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')), + ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')), + ('is_published', models.BooleanField(default=False, verbose_name='published')), + ('name', models.CharField(max_length=200, verbose_name='Name')), + ('description', models.TextField(blank=True, null=True, verbose_name='Description')), + ('eta', models.DateField(blank=True, null=True, verbose_name='ETA')), + ('due_date', models.DateField(blank=True, null=True, verbose_name='Due date')), + ('version', models.CharField(blank=True, default='1.0', help_text='Version of the compliance assessment (eg. 1.0, 2.0, etc.)', max_length=100, null=True, verbose_name='Version')), + ('status', models.CharField(blank=True, choices=[('planned', 'Planned'), ('in_progress', 'In progress'), ('in_review', 'In review'), ('done', 'Done'), ('deprecated', 'Deprecated')], default='planned', max_length=100, null=True, verbose_name='Status')), + ('criticality', models.IntegerField(default=0, verbose_name='Criticality')), + ('penetration', models.IntegerField(default=0, verbose_name='Penetration')), + ('dependency', models.IntegerField(default=0, verbose_name='Dependency')), + ('maturity', models.IntegerField(default=0, verbose_name='Maturity')), + ('trust', models.IntegerField(default=0, verbose_name='Trust')), + ('authors', models.ManyToManyField(blank=True, related_name='%(class)s_authors', to=settings.AUTH_USER_MODEL, verbose_name='Authors')), + ('compliance_assessment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.complianceassessment')), + ('entity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tprm.entity')), + ('evidence', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.evidence')), + ('folder', models.ForeignKey(default=iam.models.Folder.get_root_folder_id, on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_folder', to='iam.folder')), + ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.project', verbose_name='Project')), + ('reviewers', models.ManyToManyField(blank=True, related_name='%(class)s_reviewers', to=settings.AUTH_USER_MODEL, verbose_name='Reviewers')), + ('solutions', models.ManyToManyField(blank=True, related_name='entity_assessments', to='tprm.solution', verbose_name='Solutions')), ], options={ - "verbose_name": "Entity assessment", - "verbose_name_plural": "Entity assessments", + 'verbose_name': 'Entity assessment', + 'verbose_name_plural': 'Entity assessments', }, ), ] diff --git a/backend/tprm/migrations/0002_representative_user.py b/backend/tprm/migrations/0002_representative_user.py deleted file mode 100644 index f1ec3b0b5..000000000 --- a/backend/tprm/migrations/0002_representative_user.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 5.1.1 on 2024-09-13 15:04 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('tprm', '0001_initial'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.AddField( - model_name='representative', - name='user', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL), - ), - ]