From 6b93b549198acf9b914bd46f5f314ab015ecd6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Cant=C3=B9?= Date: Wed, 22 May 2024 10:53:43 +0200 Subject: [PATCH] add migrations --- src/genlab_bestilling/.gitignore | 1 - .../migrations/0001_initial.py | 376 ++++++++++++++++++ src/genlab_bestilling/migrations/__init__.py | 0 3 files changed, 376 insertions(+), 1 deletion(-) delete mode 100644 src/genlab_bestilling/.gitignore create mode 100644 src/genlab_bestilling/migrations/0001_initial.py create mode 100644 src/genlab_bestilling/migrations/__init__.py diff --git a/src/genlab_bestilling/.gitignore b/src/genlab_bestilling/.gitignore deleted file mode 100644 index 24a8e4d..0000000 --- a/src/genlab_bestilling/.gitignore +++ /dev/null @@ -1 +0,0 @@ -migrations diff --git a/src/genlab_bestilling/migrations/0001_initial.py b/src/genlab_bestilling/migrations/0001_initial.py new file mode 100644 index 0000000..67be8e4 --- /dev/null +++ b/src/genlab_bestilling/migrations/0001_initial.py @@ -0,0 +1,376 @@ +# Generated by Django 5.0.6 on 2024-05-21 12:50 + +import django.contrib.postgres.fields.ranges +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + initial = True + + dependencies = [ + ("contenttypes", "0002_remove_content_type_name"), + ] + + operations = [ + migrations.CreateModel( + name="Order", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("notes", models.TextField()), + ( + "polymorphic_ctype", + models.ForeignKey( + editable=False, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="polymorphic_%(app_label)s.%(class)s_set+", + to="contenttypes.contenttype", + ), + ), + ], + options={ + "abstract": False, + "base_manager_name": "objects", + }, + ), + migrations.CreateModel( + name="AnalysisType", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(blank=True, max_length=255, null=True)), + ], + ), + migrations.CreateModel( + name="Area", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=255)), + ], + ), + migrations.CreateModel( + name="EquipmentType", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(blank=True, max_length=255, null=True)), + ("unit", models.CharField(max_length=50)), + ], + ), + migrations.CreateModel( + name="GenLabProject", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(blank=True, max_length=255, null=True)), + ("project", models.BigIntegerField(verbose_name="Project number")), + ("verified", models.BooleanField(default=False)), + ("expected_total_samples", models.IntegerField(blank=True, null=True)), + ( + "analysis_timerange", + django.contrib.postgres.fields.ranges.DateRangeField( + blank=True, null=True + ), + ), + ( + "analysis_types", + models.ManyToManyField( + blank=True, to="genlab_bestilling.analysistype" + ), + ), + ( + "area", + models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, + to="genlab_bestilling.area", + ), + ), + ], + ), + migrations.CreateModel( + name="Location", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=250)), + ("river_id", models.CharField(max_length=250)), + ("station_id", models.CharField(max_length=20)), + ], + ), + migrations.CreateModel( + name="Marker", + fields=[ + ("name", models.CharField(primary_key=True, serialize=False)), + ], + ), + migrations.CreateModel( + name="Organization", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=255)), + ], + ), + migrations.CreateModel( + name="SampleType", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(blank=True, max_length=255, null=True)), + ], + ), + migrations.CreateModel( + name="AnalysisOrder", + fields=[ + ( + "order_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="genlab_bestilling.order", + ), + ), + ("has_guid", models.BooleanField()), + ("isolate_samples", models.BooleanField()), + ("return_samples", models.BooleanField()), + ( + "markers", + models.ManyToManyField(blank=True, to="genlab_bestilling.marker"), + ), + ], + options={ + "abstract": False, + "base_manager_name": "objects", + }, + bases=("genlab_bestilling.order",), + ), + migrations.CreateModel( + name="EquipmentOrder", + fields=[ + ( + "order_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="genlab_bestilling.order", + ), + ), + ("use_guid", models.BooleanField()), + ], + options={ + "abstract": False, + "base_manager_name": "objects", + }, + bases=("genlab_bestilling.order",), + ), + migrations.AddField( + model_name="order", + name="project", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="genlab_bestilling.genlabproject", + ), + ), + migrations.AddField( + model_name="genlabproject", + name="samples_owner", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.PROTECT, + to="genlab_bestilling.organization", + ), + ), + migrations.AddField( + model_name="order", + name="sample_types", + field=models.ManyToManyField(to="genlab_bestilling.sampletype"), + ), + migrations.AddField( + model_name="genlabproject", + name="sample_types", + field=models.ManyToManyField(blank=True, to="genlab_bestilling.sampletype"), + ), + migrations.CreateModel( + name="Species", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=255)), + ( + "area", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="genlab_bestilling.area", + ), + ), + ("markers", models.ManyToManyField(to="genlab_bestilling.marker")), + ], + ), + migrations.AddField( + model_name="order", + name="species", + field=models.ManyToManyField(to="genlab_bestilling.species"), + ), + migrations.AddField( + model_name="genlabproject", + name="species", + field=models.ManyToManyField(blank=True, to="genlab_bestilling.species"), + ), + migrations.CreateModel( + name="Sample", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("guid", models.CharField(blank=True, max_length=200, null=True)), + ("date", models.DateField()), + ("notes", models.TextField()), + ("pop_id", models.CharField(max_length=150)), + ("volume", models.FloatField(blank=True, null=True)), + ( + "area", + models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, + to="genlab_bestilling.area", + ), + ), + ( + "location", + models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, + to="genlab_bestilling.location", + ), + ), + ("markers", models.ManyToManyField(to="genlab_bestilling.marker")), + ( + "type", + models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, + to="genlab_bestilling.sampletype", + ), + ), + ( + "species", + models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, + to="genlab_bestilling.species", + ), + ), + ( + "order", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="genlab_bestilling.analysisorder", + ), + ), + ], + ), + migrations.CreateModel( + name="EquimentOrderQuantity", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("quantity", models.DecimalField(decimal_places=4, max_digits=14)), + ( + "equipment", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="genlab_bestilling.equipmenttype", + ), + ), + ( + "order", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="genlab_bestilling.equipmentorder", + ), + ), + ], + ), + ] diff --git a/src/genlab_bestilling/migrations/__init__.py b/src/genlab_bestilling/migrations/__init__.py new file mode 100644 index 0000000..e69de29