diff --git a/ourprojects/migrations/0001_initial.py b/ourprojects/migrations/0001_initial.py index 0047850..0963da7 100644 --- a/ourprojects/migrations/0001_initial.py +++ b/ourprojects/migrations/0001_initial.py @@ -1,6 +1,7 @@ -# Generated by Django 5.1.1 on 2024-10-18 23:40 +# Generated by Django 5.2 on 2024-11-21 10:57 import django.db.models.deletion +import lnschema_core.fields import lnschema_core.ids import lnschema_core.models import lnschema_core.users @@ -11,20 +12,37 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ("lnschema_core", "0068_alter_artifactulabel_unique_together_and_more"), + ("lnschema_core", "0069_squashed"), ] operations = [ migrations.CreateModel( name="ArtifactProject", fields=[ - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ( + "created_at", + lnschema_core.fields.DateTimeField( + auto_now_add=True, db_index=True + ), + ), ("id", models.BigAutoField(primary_key=True, serialize=False)), - ("label_ref_is_name", models.BooleanField(default=None, null=True)), - ("feature_ref_is_name", models.BooleanField(default=None, null=True)), + ( + "label_ref_is_name", + lnschema_core.fields.BooleanField( + blank=True, default=None, null=True + ), + ), + ( + "feature_ref_is_name", + lnschema_core.fields.BooleanField( + blank=True, default=None, null=True + ), + ), ( "artifact", - models.ForeignKey( + lnschema_core.fields.ForeignKey( + blank=True, + default=None, on_delete=django.db.models.deletion.CASCADE, related_name="links_project", to="lnschema_core.artifact", @@ -32,7 +50,8 @@ class Migration(migrations.Migration): ), ( "created_by", - models.ForeignKey( + lnschema_core.fields.ForeignKey( + blank=True, default=lnschema_core.users.current_user_id, on_delete=django.db.models.deletion.PROTECT, related_name="+", @@ -41,7 +60,8 @@ class Migration(migrations.Migration): ), ( "feature", - models.ForeignKey( + lnschema_core.fields.ForeignKey( + blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, @@ -51,7 +71,8 @@ class Migration(migrations.Migration): ), ( "run", - models.ForeignKey( + lnschema_core.fields.ForeignKey( + blank=True, default=lnschema_core.models.current_run, null=True, on_delete=django.db.models.deletion.PROTECT, @@ -65,19 +86,36 @@ class Migration(migrations.Migration): migrations.CreateModel( name="Project", fields=[ - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ( + "created_at", + lnschema_core.fields.DateTimeField( + auto_now_add=True, db_index=True + ), + ), + ( + "updated_at", + lnschema_core.fields.DateTimeField(auto_now=True, db_index=True), + ), ("id", models.AutoField(primary_key=True, serialize=False)), ( "uid", - models.CharField( - default=lnschema_core.ids.base62_12, max_length=12, unique=True + lnschema_core.fields.CharField( + blank=True, + default=lnschema_core.ids.base62_12, + max_length=12, + unique=True, + ), + ), + ( + "name", + lnschema_core.fields.CharField( + blank=True, db_index=True, default=None, max_length=255 ), ), - ("name", models.CharField(db_index=True, default=None, max_length=255)), ( "abbr", - models.CharField( + lnschema_core.fields.CharField( + blank=True, db_index=True, default=None, max_length=32, @@ -85,7 +123,12 @@ class Migration(migrations.Migration): unique=True, ), ), - ("url", models.URLField(default=None, max_length=255, null=True)), + ( + "url", + lnschema_core.fields.URLField( + blank=True, default=None, max_length=255, null=True + ), + ), ( "_previous_runs", models.ManyToManyField(related_name="+", to="lnschema_core.run"), @@ -100,7 +143,8 @@ class Migration(migrations.Migration): ), ( "created_by", - models.ForeignKey( + lnschema_core.fields.ForeignKey( + blank=True, default=lnschema_core.users.current_user_id, on_delete=django.db.models.deletion.PROTECT, related_name="+", @@ -109,7 +153,8 @@ class Migration(migrations.Migration): ), ( "run", - models.ForeignKey( + lnschema_core.fields.ForeignKey( + blank=True, default=lnschema_core.models.current_run, null=True, on_delete=django.db.models.deletion.PROTECT, @@ -121,12 +166,18 @@ class Migration(migrations.Migration): options={ "abstract": False, }, - bases=(lnschema_core.models.CanCurate, models.Model), + bases=( + lnschema_core.models.CanCurate, + models.Model, + lnschema_core.models.ValidateFields, + ), ), migrations.AddField( model_name="artifactproject", name="project", - field=models.ForeignKey( + field=lnschema_core.fields.ForeignKey( + blank=True, + default=None, on_delete=django.db.models.deletion.PROTECT, related_name="links_artifact", to="ourprojects.project", diff --git a/ourprojects/migrations/0002_alter_artifactproject_artifact_and_more.py b/ourprojects/migrations/0002_alter_artifactproject_artifact_and_more.py deleted file mode 100644 index 4702e4d..0000000 --- a/ourprojects/migrations/0002_alter_artifactproject_artifact_and_more.py +++ /dev/null @@ -1,163 +0,0 @@ -# Generated by Django 5.2 on 2024-11-21 10:48 - -import django.db.models.deletion -import lnschema_core.fields -import lnschema_core.ids -import lnschema_core.models -import lnschema_core.users -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("lnschema_core", "0069_squashed"), - ("ourprojects", "0001_initial"), - ] - - operations = [ - migrations.AlterField( - model_name="artifactproject", - name="artifact", - field=lnschema_core.fields.ForeignKey( - blank=True, - default=None, - on_delete=django.db.models.deletion.CASCADE, - related_name="links_project", - to="lnschema_core.artifact", - ), - ), - migrations.AlterField( - model_name="artifactproject", - name="created_at", - field=lnschema_core.fields.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="artifactproject", - name="created_by", - field=lnschema_core.fields.ForeignKey( - blank=True, - default=lnschema_core.users.current_user_id, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="lnschema_core.user", - ), - ), - migrations.AlterField( - model_name="artifactproject", - name="feature", - field=lnschema_core.fields.ForeignKey( - blank=True, - default=None, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="links_artifactproject", - to="lnschema_core.feature", - ), - ), - migrations.AlterField( - model_name="artifactproject", - name="feature_ref_is_name", - field=lnschema_core.fields.BooleanField( - blank=True, default=None, null=True - ), - ), - migrations.AlterField( - model_name="artifactproject", - name="label_ref_is_name", - field=lnschema_core.fields.BooleanField( - blank=True, default=None, null=True - ), - ), - migrations.AlterField( - model_name="artifactproject", - name="project", - field=lnschema_core.fields.ForeignKey( - blank=True, - default=None, - on_delete=django.db.models.deletion.PROTECT, - related_name="links_artifact", - to="ourprojects.project", - ), - ), - migrations.AlterField( - model_name="artifactproject", - name="run", - field=lnschema_core.fields.ForeignKey( - blank=True, - default=lnschema_core.models.current_run, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="lnschema_core.run", - ), - ), - migrations.AlterField( - model_name="project", - name="abbr", - field=lnschema_core.fields.CharField( - blank=True, - db_index=True, - default=None, - max_length=32, - null=True, - unique=True, - ), - ), - migrations.AlterField( - model_name="project", - name="created_at", - field=lnschema_core.fields.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="project", - name="created_by", - field=lnschema_core.fields.ForeignKey( - blank=True, - default=lnschema_core.users.current_user_id, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="lnschema_core.user", - ), - ), - migrations.AlterField( - model_name="project", - name="name", - field=lnschema_core.fields.CharField( - blank=True, db_index=True, default=None, max_length=255 - ), - ), - migrations.AlterField( - model_name="project", - name="run", - field=lnschema_core.fields.ForeignKey( - blank=True, - default=lnschema_core.models.current_run, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="lnschema_core.run", - ), - ), - migrations.AlterField( - model_name="project", - name="uid", - field=lnschema_core.fields.CharField( - blank=True, - default=lnschema_core.ids.base62_12, - max_length=12, - unique=True, - ), - ), - migrations.AlterField( - model_name="project", - name="updated_at", - field=lnschema_core.fields.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="project", - name="url", - field=lnschema_core.fields.URLField( - blank=True, default=None, max_length=255, null=True - ), - ), - ]