diff --git a/thunorweb/migrations/0001_squashed_0011_automatic_controls.py b/thunorweb/migrations/0001_squashed_0011_automatic_controls.py deleted file mode 100644 index ab611057..00000000 --- a/thunorweb/migrations/0001_squashed_0011_automatic_controls.py +++ /dev/null @@ -1,218 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.6 on 2018-02-17 20:04 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import thunor.io - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('auth', '0008_alter_user_username_max_length'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='CellLine', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.TextField(unique=True)), - ], - ), - migrations.CreateModel( - name='Drug', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.TextField(unique=True)), - ], - ), - migrations.CreateModel( - name='HTSDataset', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.TextField()), - ('creation_date', models.DateTimeField(auto_now_add=True)), - ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Plate', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.TextField()), - ('last_annotated', models.DateTimeField(null=True)), - ('width', models.IntegerField()), - ('height', models.IntegerField()), - ('dataset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.HTSDataset')), - ], - bases=(models.Model, thunor.io.PlateMap), - ), - migrations.CreateModel( - name='PlateFile', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('upload_date', models.DateTimeField(auto_now_add=True)), - ('file', models.FileField(upload_to='plate-files')), - ('file_format', models.TextField(null=True)), - ('dataset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.HTSDataset')), - ], - ), - migrations.CreateModel( - name='Well', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('well_num', models.IntegerField()), - ('cell_line', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='thunorweb.CellLine')), - ('plate', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.Plate')), - ], - ), - migrations.CreateModel( - name='WellDrug', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('dose', models.FloatField(null=True)), - ('drug', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.Drug')), - ('well', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.Well')), - ('order', models.PositiveSmallIntegerField(default=0)), - ], - ), - migrations.CreateModel( - name='WellMeasurement', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('assay', models.TextField()), - ('timepoint', models.DurationField()), - ('value', models.FloatField(null=True)), - ('well', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.Well')), - ], - ), - migrations.AlterUniqueTogether( - name='wellmeasurement', - unique_together=set([('well', 'assay', 'timepoint')]), - ), - migrations.AlterIndexTogether( - name='wellmeasurement', - index_together=set([('well', 'assay', 'timepoint')]), - ), - migrations.AlterUniqueTogether( - name='well', - unique_together=set([('plate', 'well_num')]), - ), - migrations.AlterIndexTogether( - name='well', - index_together=set([('plate', 'well_num')]), - ), - migrations.AddField( - model_name='plate', - name='expt_date', - field=models.DateField(null=True), - ), - migrations.AddField( - model_name='plate', - name='expt_id', - field=models.TextField(null=True), - ), - migrations.AlterUniqueTogether( - name='plate', - unique_together=set([('dataset', 'name')]), - ), - migrations.AlterUniqueTogether( - name='welldrug', - unique_together=set([('well', 'order'), ('well', 'drug')]), - ), - migrations.AlterField( - model_name='welldrug', - name='drug', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='thunorweb.Drug'), - ), - migrations.AlterIndexTogether( - name='welldrug', - index_together=set([('well', 'drug', 'order')]), - ), - migrations.CreateModel( - name='HTSDatasetGroupObjectPermission', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('content_object', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.HTSDataset')), - ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='auth.Group')), - ('permission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='auth.Permission')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='HTSDatasetUserObjectPermission', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('content_object', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.HTSDataset')), - ('permission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='auth.Permission')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'abstract': False, - }, - ), - migrations.AlterUniqueTogether( - name='htsdatasetuserobjectpermission', - unique_together=set([('user', 'permission', 'content_object')]), - ), - migrations.AlterUniqueTogether( - name='htsdatasetgroupobjectpermission', - unique_together=set([('group', 'permission', 'content_object')]), - ), - migrations.AlterModelOptions( - name='htsdataset', - options={'permissions': (('view_plots', 'View plots'), ('view_plate_layout', 'View plate layout'), ('download_data', 'Download data'))}, - ), - migrations.CreateModel( - name='WellStatistic', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('stat_name', models.TextField()), - ('stat_date', models.DateTimeField(auto_now=True)), - ('value', models.FloatField(null=True)), - ('well', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.Well')), - ], - ), - migrations.CreateModel( - name='CellLineTag', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('tag_name', models.TextField()), - ('cell_line', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.CellLine')), - ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='DrugTag', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('tag_name', models.TextField()), - ('drug', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='thunorweb.Drug')), - ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.AlterUniqueTogether( - name='drugtag', - unique_together=set([('tag_name', 'owner', 'drug')]), - ), - migrations.AlterIndexTogether( - name='drugtag', - index_together=set([('tag_name', 'owner', 'drug')]), - ), - migrations.AlterUniqueTogether( - name='celllinetag', - unique_together=set([('tag_name', 'owner', 'cell_line')]), - ), - migrations.AlterIndexTogether( - name='celllinetag', - index_together=set([('tag_name', 'owner', 'cell_line')]), - ), - ] diff --git a/thunorweb/migrations/0001_squashed_0011_automatic_controls_squashed_0005_drop_duplicate_idxs.py b/thunorweb/migrations/0001_squashed_0011_automatic_controls_squashed_0005_drop_duplicate_idxs.py new file mode 100644 index 00000000..7ede3210 --- /dev/null +++ b/thunorweb/migrations/0001_squashed_0011_automatic_controls_squashed_0005_drop_duplicate_idxs.py @@ -0,0 +1,420 @@ +# Generated by Django 4.2.16 on 2024-09-03 21:01 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import thunor.io + + +class Migration(migrations.Migration): + + replaces = [ + ("thunorweb", "0001_squashed_0011_automatic_controls"), + ("thunorweb", "0002_dataset_delete_flag"), + ("thunorweb", "0003_dataset_admin"), + ("thunorweb", "0004_optim_indexes"), + ("thunorweb", "0005_drop_duplicate_idxs"), + ] + + dependencies = [ + ("auth", "0008_alter_user_username_max_length"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name="CellLine", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.TextField(unique=True)), + ], + ), + migrations.CreateModel( + name="Drug", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.TextField(unique=True)), + ], + ), + migrations.CreateModel( + name="HTSDataset", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.TextField()), + ("creation_date", models.DateTimeField(auto_now_add=True)), + ( + "owner", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ( + "deleted_date", + models.DateTimeField(default=None, editable=False, null=True), + ), + ], + options={ + "permissions": ( + ("view_plots", "View plots"), + ("view_plate_layout", "View plate layout"), + ("download_data", "Download data"), + ), + "verbose_name": "HTS Dataset", + }, + ), + migrations.CreateModel( + name="Plate", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.TextField()), + ("last_annotated", models.DateTimeField(null=True)), + ("width", models.IntegerField()), + ("height", models.IntegerField()), + ( + "dataset", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="thunorweb.htsdataset", + ), + ), + ("expt_date", models.DateField(null=True)), + ("expt_id", models.TextField(null=True)), + ], + options={ + "unique_together": {("dataset", "name")}, + }, + bases=(models.Model, thunor.io.PlateMap), + ), + migrations.CreateModel( + name="PlateFile", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("upload_date", models.DateTimeField(auto_now_add=True)), + ("file", models.FileField(upload_to="plate-files")), + ("file_format", models.TextField(null=True)), + ( + "dataset", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="thunorweb.htsdataset", + ), + ), + ], + ), + migrations.CreateModel( + name="Well", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("well_num", models.IntegerField()), + ( + "cell_line", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="thunorweb.cellline", + ), + ), + ( + "plate", + models.ForeignKey( + db_index=False, + on_delete=django.db.models.deletion.CASCADE, + to="thunorweb.plate", + ), + ), + ], + options={ + "unique_together": {("plate", "well_num")}, + }, + ), + migrations.CreateModel( + name="HTSDatasetUserObjectPermission", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "content_object", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="thunorweb.htsdataset", + ), + ), + ( + "permission", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="auth.permission", + ), + ), + ( + "user", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "abstract": False, + "unique_together": {("user", "permission", "content_object")}, + }, + ), + migrations.CreateModel( + name="HTSDatasetGroupObjectPermission", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "content_object", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="thunorweb.htsdataset", + ), + ), + ( + "group", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="auth.group" + ), + ), + ( + "permission", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="auth.permission", + ), + ), + ], + options={ + "abstract": False, + "unique_together": {("group", "permission", "content_object")}, + }, + ), + migrations.CreateModel( + name="DeletedHTSDataset", + fields=[], + options={ + "verbose_name": "Deleted HTS Dataset", + "proxy": True, + "indexes": [], + }, + bases=("thunorweb.htsdataset",), + ), + migrations.CreateModel( + name="WellStatistic", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("stat_name", models.TextField()), + ("stat_date", models.DateTimeField(auto_now=True)), + ("value", models.FloatField(null=True)), + ( + "well", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="thunorweb.well" + ), + ), + ], + options={ + "unique_together": {("well", "stat_name")}, + }, + ), + migrations.CreateModel( + name="CellLineTag", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("tag_name", models.TextField()), + ( + "cell_line", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="thunorweb.cellline", + ), + ), + ( + "owner", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "unique_together": {("tag_name", "owner", "cell_line")}, + }, + ), + migrations.CreateModel( + name="DrugTag", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("tag_name", models.TextField()), + ( + "drug", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="thunorweb.drug" + ), + ), + ( + "owner", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ], + options={ + "unique_together": {("tag_name", "owner", "drug")}, + }, + ), + migrations.CreateModel( + name="WellDrug", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("dose", models.FloatField(null=True)), + ( + "drug", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="thunorweb.drug", + ), + ), + ( + "well", + models.ForeignKey( + db_index=False, + on_delete=django.db.models.deletion.CASCADE, + to="thunorweb.well", + ), + ), + ("order", models.PositiveSmallIntegerField()), + ], + options={ + "unique_together": {("well", "drug"), ("well", "order")}, + }, + ), + migrations.CreateModel( + name="WellMeasurement", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("assay", models.TextField()), + ("timepoint", models.DurationField()), + ("value", models.FloatField(null=True)), + ( + "well", + models.ForeignKey( + db_index=False, + on_delete=django.db.models.deletion.CASCADE, + to="thunorweb.well", + ), + ), + ], + options={ + "unique_together": {("well", "assay", "timepoint")}, + }, + ), + ] diff --git a/thunorweb/migrations/0002_dataset_delete_flag.py b/thunorweb/migrations/0002_dataset_delete_flag.py deleted file mode 100644 index bd6c6d11..00000000 --- a/thunorweb/migrations/0002_dataset_delete_flag.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.6 on 2018-02-24 03:25 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('thunorweb', '0001_squashed_0011_automatic_controls'), - ] - - operations = [ - migrations.AddField( - model_name='htsdataset', - name='deleted_date', - field=models.DateTimeField(default=None, null=True), - ), - migrations.AlterField( - model_name='welldrug', - name='order', - field=models.PositiveSmallIntegerField(), - ), - ] diff --git a/thunorweb/migrations/0003_dataset_admin.py b/thunorweb/migrations/0003_dataset_admin.py deleted file mode 100644 index 64b60e92..00000000 --- a/thunorweb/migrations/0003_dataset_admin.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.10 on 2018-04-03 18:39 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('thunorweb', '0002_dataset_delete_flag'), - ] - - operations = [ - migrations.CreateModel( - name='DeletedHTSDataset', - fields=[ - ], - options={ - 'verbose_name': 'Deleted HTS Dataset', - 'proxy': True, - 'indexes': [], - }, - bases=('thunorweb.htsdataset',), - ), - migrations.AlterModelOptions( - name='htsdataset', - options={'permissions': (('view_plots', 'View plots'), ('view_plate_layout', 'View plate layout'), ('download_data', 'Download data')), 'verbose_name': 'HTS Dataset'}, - ), - migrations.AlterField( - model_name='htsdataset', - name='deleted_date', - field=models.DateTimeField(default=None, editable=False, null=True), - ), - ] diff --git a/thunorweb/migrations/0004_optim_indexes.py b/thunorweb/migrations/0004_optim_indexes.py deleted file mode 100644 index cfe69254..00000000 --- a/thunorweb/migrations/0004_optim_indexes.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.10 on 2018-04-05 21:31 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('thunorweb', '0003_dataset_admin'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='wellstatistic', - unique_together=set([('well', 'stat_name')]), - ), - migrations.AlterIndexTogether( - name='celllinetag', - index_together=set([]), - ), - migrations.AlterIndexTogether( - name='drugtag', - index_together=set([]), - ), - migrations.AlterIndexTogether( - name='well', - index_together=set([]), - ), - migrations.AlterIndexTogether( - name='welldrug', - index_together=set([]), - ), - migrations.AlterIndexTogether( - name='wellmeasurement', - index_together=set([]), - ), - ] diff --git a/thunorweb/migrations/0005_drop_duplicate_idxs.py b/thunorweb/migrations/0005_drop_duplicate_idxs.py deleted file mode 100644 index 7200cbac..00000000 --- a/thunorweb/migrations/0005_drop_duplicate_idxs.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.10 on 2018-04-07 21:14 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('thunorweb', '0004_optim_indexes'), - ] - - operations = [ - migrations.AlterField( - model_name='well', - name='plate', - field=models.ForeignKey(db_index=False, on_delete=django.db.models.deletion.CASCADE, to='thunorweb.Plate'), - ), - migrations.AlterField( - model_name='welldrug', - name='well', - field=models.ForeignKey(db_index=False, on_delete=django.db.models.deletion.CASCADE, to='thunorweb.Well'), - ), - migrations.AlterField( - model_name='wellmeasurement', - name='well', - field=models.ForeignKey(db_index=False, on_delete=django.db.models.deletion.CASCADE, to='thunorweb.Well'), - ), - ]