From fa83246190e235fcffe34a1dc3371450e3d53ab3 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 11 Dec 2023 19:51:05 -0500 Subject: [PATCH] fix allocation migration 0014 --- .../migrations/0014_auto_20231004_1242.py | 96 --------- .../migrations/0014_auto_20231211_1932.py | 182 ++++++++++++++++++ 2 files changed, 182 insertions(+), 96 deletions(-) delete mode 100644 coldfront/core/allocation/migrations/0014_auto_20231004_1242.py create mode 100644 coldfront/core/allocation/migrations/0014_auto_20231211_1932.py diff --git a/coldfront/core/allocation/migrations/0014_auto_20231004_1242.py b/coldfront/core/allocation/migrations/0014_auto_20231004_1242.py deleted file mode 100644 index a43d06769..000000000 --- a/coldfront/core/allocation/migrations/0014_auto_20231004_1242.py +++ /dev/null @@ -1,96 +0,0 @@ -# Generated by Django 3.2.17 on 2023-10-04 16:42 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('allocation', '0013_allocationaccount'), - ] - - operations = [ - migrations.AlterModelOptions( - name='allocation', - options={'ordering': ['project'], 'permissions': (('can_view_all_allocations', 'Can view all allocations'), ('can_review_allocation_requests', 'Can review allocation requests'), ('can_manage_invoice', 'Can manage invoice'))}, - ), - migrations.AlterModelOptions( - name='historicalallocation', - options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation', 'verbose_name_plural': 'historical allocations'}, - ), - migrations.AlterModelOptions( - name='historicalallocationattribute', - options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation attribute', 'verbose_name_plural': 'historical allocation attributes'}, - ), - migrations.AlterModelOptions( - name='historicalallocationattributechangerequest', - options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation attribute change request', 'verbose_name_plural': 'historical allocation attribute change requests'}, - ), - migrations.AlterModelOptions( - name='historicalallocationattributetype', - options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation attribute type', 'verbose_name_plural': 'historical allocation attribute types'}, - ), - migrations.AlterModelOptions( - name='historicalallocationattributeusage', - options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation attribute usage', 'verbose_name_plural': 'historical allocation attribute usages'}, - ), - migrations.AlterModelOptions( - name='historicalallocationchangerequest', - options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation change request', 'verbose_name_plural': 'historical allocation change requests'}, - ), - migrations.AlterModelOptions( - name='historicalallocationuser', - options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation user', 'verbose_name_plural': 'historical Allocation User Status'}, - ), - migrations.RemoveField( - model_name='allocationuser', - name='allocation_group_quota', - ), - migrations.RemoveField( - model_name='allocationuser', - name='allocation_group_usage_bytes', - ), - migrations.RemoveField( - model_name='historicalallocationuser', - name='allocation_group_quota', - ), - migrations.RemoveField( - model_name='historicalallocationuser', - name='allocation_group_usage_bytes', - ), - migrations.AlterField( - model_name='historicalallocation', - name='history_date', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='historicalallocationattribute', - name='history_date', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='historicalallocationattributechangerequest', - name='history_date', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='historicalallocationattributetype', - name='history_date', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='historicalallocationattributeusage', - name='history_date', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='historicalallocationchangerequest', - name='history_date', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='historicalallocationuser', - name='history_date', - field=models.DateTimeField(db_index=True), - ), - ] diff --git a/coldfront/core/allocation/migrations/0014_auto_20231211_1932.py b/coldfront/core/allocation/migrations/0014_auto_20231211_1932.py new file mode 100644 index 000000000..d6288e7f0 --- /dev/null +++ b/coldfront/core/allocation/migrations/0014_auto_20231211_1932.py @@ -0,0 +1,182 @@ +# Generated by Django 3.2.17 on 2023-12-12 00:32 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone +import model_utils.fields +import simple_history.models + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('allocation', '0013_allocationaccount'), + ] + + operations = [ + migrations.CreateModel( + name='AllocationUserAttributeType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), + ('name', models.CharField(max_length=50)), + ('is_required', models.BooleanField(default=False)), + ('is_unique', models.BooleanField(default=False)), + ('is_private', models.BooleanField(default=True)), + ('is_changeable', models.BooleanField(default=False)), + ('attribute_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='allocation.attributetype')), + ], + options={ + 'ordering': ['name'], + }, + ), + migrations.AlterModelOptions( + name='allocation', + options={'ordering': ['project'], 'permissions': (('can_view_all_allocations', 'Can view all allocations'), ('can_review_allocation_requests', 'Can review allocation requests'), ('can_manage_invoice', 'Can manage invoice'))}, + ), + migrations.AlterModelOptions( + name='historicalallocation', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation', 'verbose_name_plural': 'historical allocations'}, + ), + migrations.AlterModelOptions( + name='historicalallocationattribute', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation attribute', 'verbose_name_plural': 'historical allocation attributes'}, + ), + migrations.AlterModelOptions( + name='historicalallocationattributechangerequest', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation attribute change request', 'verbose_name_plural': 'historical allocation attribute change requests'}, + ), + migrations.AlterModelOptions( + name='historicalallocationattributetype', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation attribute type', 'verbose_name_plural': 'historical allocation attribute types'}, + ), + migrations.AlterModelOptions( + name='historicalallocationattributeusage', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation attribute usage', 'verbose_name_plural': 'historical allocation attribute usages'}, + ), + migrations.AlterModelOptions( + name='historicalallocationchangerequest', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation change request', 'verbose_name_plural': 'historical allocation change requests'}, + ), + migrations.AlterModelOptions( + name='historicalallocationuser', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical allocation user', 'verbose_name_plural': 'historical Allocation User Status'}, + ), + migrations.RemoveField( + model_name='allocationuser', + name='allocation_group_quota', + ), + migrations.RemoveField( + model_name='allocationuser', + name='allocation_group_usage_bytes', + ), + migrations.RemoveField( + model_name='historicalallocationuser', + name='allocation_group_quota', + ), + migrations.RemoveField( + model_name='historicalallocationuser', + name='allocation_group_usage_bytes', + ), + migrations.AlterField( + model_name='historicalallocation', + name='history_date', + field=models.DateTimeField(db_index=True), + ), + migrations.AlterField( + model_name='historicalallocationattribute', + name='history_date', + field=models.DateTimeField(db_index=True), + ), + migrations.AlterField( + model_name='historicalallocationattributechangerequest', + name='history_date', + field=models.DateTimeField(db_index=True), + ), + migrations.AlterField( + model_name='historicalallocationattributetype', + name='history_date', + field=models.DateTimeField(db_index=True), + ), + migrations.AlterField( + model_name='historicalallocationattributeusage', + name='history_date', + field=models.DateTimeField(db_index=True), + ), + migrations.AlterField( + model_name='historicalallocationchangerequest', + name='history_date', + field=models.DateTimeField(db_index=True), + ), + migrations.AlterField( + model_name='historicalallocationuser', + name='history_date', + field=models.DateTimeField(db_index=True), + ), + migrations.CreateModel( + name='HistoricalAllocationUserAttributeType', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), + ('name', models.CharField(max_length=50)), + ('is_required', models.BooleanField(default=False)), + ('is_unique', models.BooleanField(default=False)), + ('is_private', models.BooleanField(default=True)), + ('is_changeable', models.BooleanField(default=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)), + ('attribute_type', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='allocation.attributetype')), + ('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 allocation user attribute type', + 'verbose_name_plural': 'historical allocation user attribute types', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': ('history_date', 'history_id'), + }, + bases=(simple_history.models.HistoricalChanges, models.Model), + ), + migrations.CreateModel( + name='HistoricalAllocationUserAttribute', + fields=[ + ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), + ('value', models.CharField(max_length=128)), + ('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)), + ('allocationuser', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='allocation.allocationuser')), + ('allocationuser_attribute_type', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='allocation.allocationuserattributetype')), + ('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 allocation user attribute', + 'verbose_name_plural': 'historical allocation user attributes', + 'ordering': ('-history_date', '-history_id'), + 'get_latest_by': ('history_date', 'history_id'), + }, + bases=(simple_history.models.HistoricalChanges, models.Model), + ), + migrations.CreateModel( + name='AllocationUserAttribute', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), + ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), + ('value', models.CharField(max_length=128)), + ('allocationuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='allocation.allocationuser')), + ('allocationuser_attribute_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='allocation.allocationuserattributetype')), + ], + options={ + 'abstract': False, + }, + ), + ]