Skip to content

Commit

Permalink
add migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed May 22, 2024
1 parent 733a92e commit 6b93b54
Show file tree
Hide file tree
Showing 3 changed files with 376 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/genlab_bestilling/.gitignore

This file was deleted.

376 changes: 376 additions & 0 deletions src/genlab_bestilling/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -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",
),
),
],
),
]
Empty file.

0 comments on commit 6b93b54

Please sign in to comment.