diff --git a/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py b/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py index a0cb8f6c70c78c724241fee30ce050a1a50cad2c..f0bc5bb3015313d75fb76b1840d6ee856cee9235 100644 --- a/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py +++ b/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.0.9 on 2020-10-16 10:16 +# Generated by Django 3.0.9 on 2020-10-27 16:04 from django.conf import settings import django.contrib.postgres.fields @@ -17,34 +17,6 @@ class Migration(migrations.Migration): ] operations = [ - migrations.CreateModel( - name='SchedulingUnitBlueprintSummary', - fields=[ - ('id', models.IntegerField(primary_key=True, serialize=False)), - ('sub_id', models.IntegerField()), - ('taskblueprint_id', models.IntegerField()), - ('task_type', models.CharField(max_length=128)), - ('derived_task_status', models.CharField(max_length=128)), - ], - options={ - 'db_table': 'tmssapp_schedulingunitblueprintsummary', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TaskBlueprintSummary', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('taskblueprint_id', models.IntegerField()), - ('subtask_id', models.IntegerField()), - ('substate', models.CharField(max_length=128)), - ('subtask_type', models.CharField(max_length=128)), - ], - options={ - 'db_table': 'tmssapp_taskblueprintsummary', - 'managed': False, - }, - ), migrations.CreateModel( name='Algorithm', fields=[ @@ -62,7 +34,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('rcus', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), size=128)), ('inputs', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=128), blank=True, size=128)), ], @@ -78,7 +50,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('location', models.CharField(help_text='Human-readable location of the cluster.', max_length=128)), ('archive_site', models.BooleanField(default=False, help_text='TRUE if this cluster is an archive site, FALSE if not (f.e. a local cluster, or user-owned cluster).')), ], @@ -94,7 +66,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.IntegerField(editable=False, help_text='Version of this template (with respect to other templates of the same name)')), ('schema', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schema for the configurable parameters needed to use this template.')), ], @@ -117,7 +89,7 @@ class Migration(migrations.Migration): ('tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=128), blank=True, default=list, help_text='User-defined search keywords for object.', size=8)), ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128, primary_key=True, serialize=False)), ('start', models.DateTimeField(help_text='Moment at which the cycle starts, that is, when its projects can run.')), ('stop', models.DateTimeField(help_text='Moment at which the cycle officially ends.')), @@ -186,7 +158,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.IntegerField(editable=False, help_text='Version of this template (with respect to other templates of the same name)')), ('schema', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schema for the configurable parameters needed to use this template.')), ], @@ -215,7 +187,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.IntegerField(editable=False, help_text='Version of this template (with respect to other templates of the same name)')), ('schema', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schema for the configurable parameters needed to use this template.')), ], @@ -344,7 +316,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('capacity', models.BigIntegerField(help_text='Capacity in bytes')), ('directory', models.CharField(help_text='Root directory under which we are allowed to write our data.', max_length=1024)), ], @@ -369,7 +341,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.IntegerField(editable=False, help_text='Version of this template (with respect to other templates of the same name)')), ('schema', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schema for the configurable parameters needed to use this template.')), ('create_function', models.CharField(help_text='Python function to call to execute the generator.', max_length=128)), @@ -393,7 +365,7 @@ class Migration(migrations.Migration): ('tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=128), blank=True, default=list, help_text='User-defined search keywords for object.', size=8)), ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128, primary_key=True, serialize=False)), ('priority_rank', models.FloatField(help_text='Priority of this project w.r.t. other projects. Projects can interrupt observations of lower-priority projects.')), ('trigger_priority', models.IntegerField(default=1000, help_text='Priority of this project w.r.t. triggers.')), @@ -438,7 +410,7 @@ class Migration(migrations.Migration): ('tags', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=128), blank=True, default=list, help_text='User-defined search keywords for object.', size=8)), ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128, primary_key=True, serialize=False)), ], options={ @@ -475,7 +447,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.IntegerField(editable=False, help_text='Version of this template (with respect to other templates of the same name)')), ('schema', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schema for the configurable parameters needed to use this template.')), ], @@ -500,7 +472,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.IntegerField(editable=False, help_text='Version of this template (with respect to other templates of the same name)')), ('schema', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schema for the configurable parameters needed to use this template.')), ], @@ -525,7 +497,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('generator_doc', django.contrib.postgres.fields.jsonb.JSONField(help_text='Parameters for the generator (NULLable).', null=True)), ], options={ @@ -540,7 +512,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('requirements_doc', django.contrib.postgres.fields.jsonb.JSONField(help_text='Scheduling and/or quality requirements for this scheduling unit (IMMUTABLE).')), ('do_cancel', models.BooleanField()), ], @@ -556,7 +528,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('requirements_doc', django.contrib.postgres.fields.jsonb.JSONField(help_text='Scheduling and/or quality requirements for this run.')), ('generator_instance_doc', django.contrib.postgres.fields.jsonb.JSONField(help_text='Parameter value that generated this run draft (NULLable).', null=True)), ('scheduling_constraints_doc', django.contrib.postgres.fields.jsonb.JSONField(help_text='Scheduling Constraints for this run.', null=True)), @@ -573,7 +545,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.CharField(help_text='Version of this template (with respect to other templates of the same name).', max_length=128)), ('template', django.contrib.postgres.fields.jsonb.JSONField(help_text='JSON-data compliant with the JSON-schema in the scheduling_unit_template. This observation strategy template like a predefined recipe with all the correct settings, and defines which parameters the user can alter.')), ], @@ -589,7 +561,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.IntegerField(editable=False, help_text='Version of this template (with respect to other templates of the same name)')), ('schema', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schema for the configurable parameters needed to use this template.')), ], @@ -679,7 +651,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.IntegerField(editable=False, help_text='Version of this template (with respect to other templates of the same name)')), ('schema', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schema for the configurable parameters needed to use this template.')), ('queue', models.BooleanField(default=False)), @@ -714,7 +686,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('specifications_doc', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schedulings for this task (IMMUTABLE).')), ('do_cancel', models.BooleanField(help_text='Cancel this task.')), ], @@ -742,7 +714,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('specifications_doc', django.contrib.postgres.fields.jsonb.JSONField(help_text='Specifications for this task.')), ], options={ @@ -783,7 +755,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.IntegerField(editable=False, help_text='Version of this template (with respect to other templates of the same name)')), ('schema', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schema for the configurable parameters needed to use this template.')), ], @@ -821,7 +793,7 @@ class Migration(migrations.Migration): ('created_at', models.DateTimeField(auto_now_add=True, help_text='Moment of object creation.')), ('updated_at', models.DateTimeField(auto_now=True, help_text='Moment of last object update.')), ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), - ('description', models.CharField(blank=True, help_text='A longer description of this object.', max_length=255)), + ('description', models.CharField(blank=True, default='', help_text='A longer description of this object.', max_length=255)), ('version', models.IntegerField(editable=False, help_text='Version of this template (with respect to other templates of the same name)')), ('schema', django.contrib.postgres.fields.jsonb.JSONField(help_text='Schema for the configurable parameters needed to use this template.')), ('validation_code_js', models.CharField(blank=True, default='', help_text='JavaScript code for additional (complex) validation.', max_length=128)), @@ -1177,7 +1149,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='project', name='cycles', - field=models.ManyToManyField(blank=True, help_text='Cycles to which this project belongs (NULLable).', related_name='projects', to='tmssapp.Cycle'), + field=models.ManyToManyField(help_text='Cycles to which this project belongs (NULLable).', null=True, related_name='projects', to='tmssapp.Cycle'), ), migrations.AddField( model_name='project', @@ -1289,7 +1261,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='dataproduct', name='sap', - field=models.ForeignKey(help_text='SAP this dataproduct was generated out of (NULLable).', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='SAP_dataproducts', to='tmssapp.SAP'), + field=models.ForeignKey(help_text='SAP this dataproduct was generated out of (NULLable).', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='dataproducts', to='tmssapp.SAP'), ), migrations.AddField( model_name='dataproduct', diff --git a/SAS/TMSS/src/tmss/tmssapp/models/specification.py b/SAS/TMSS/src/tmss/tmssapp/models/specification.py index b84696e6bfc42b711fbe7d61c5dd624c88619392..d24d530fcc5eb37ac1decc4341b3f4283a1af5b1 100644 --- a/SAS/TMSS/src/tmss/tmssapp/models/specification.py +++ b/SAS/TMSS/src/tmss/tmssapp/models/specification.py @@ -380,35 +380,6 @@ class DefaultTaskRelationSelectionTemplate(BasicCommon): name = CharField(max_length=128, unique=True) template = ForeignKey("TaskRelationSelectionTemplate", on_delete=PROTECT) - -# -# DatabaseView objects -# -class TaskBlueprintSummary(Model): - taskblueprint_id = IntegerField() - subtask_id = IntegerField() - substate = CharField(max_length=128) - subtask_type = CharField(max_length=128) - - class Meta: - managed = False - db_table = 'tmssapp_taskblueprintsummary' - - -class SchedulingUnitBlueprintSummary(Model): - # Using in an id and ForeignKey is not common for a view BUT the id is a 'dummy' to be able to use in Django - # https://resources.rescale.com/using-database-views-in-django-orm/ - # otherwise an exception will be thrown - id = IntegerField(primary_key=True) - sub_id = IntegerField() - taskblueprint_id = IntegerField() - task_type = CharField(max_length=128) - derived_task_status = CharField(max_length=128) - - class Meta: - managed = False - db_table = 'tmssapp_schedulingunitblueprintsummary' - # # Instance Objects #