Skip to content

Commit

Permalink
Make TileModel.data not nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Jan 10, 2025
1 parent 4cf845e commit 774e857
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
18 changes: 18 additions & 0 deletions arches/app/models/migrations/11725_make_tiledata_not_nullable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.2.dev20250109163842 on 2025-01-10 15:56

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("models", "11725_add_blank_and_related_names"),
]

operations = [
migrations.AlterField(
model_name="tilemodel",
name="data",
field=models.JSONField(blank=True, db_column="tiledata", default=dict),
),
]
2 changes: 1 addition & 1 deletion arches/app/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ class TileModel(models.Model): # Tile
related_name="children",
related_query_name="child",
)
data = JSONField(blank=True, null=True, db_column="tiledata")
data = JSONField(blank=True, default=dict, db_column="tiledata")
nodegroup_id = models.UUIDField(db_column="nodegroupid", null=True)
sortorder = models.IntegerField(blank=True, null=True, default=0)
provisionaledits = JSONField(blank=True, null=True, db_column="provisionaledits")
Expand Down
3 changes: 2 additions & 1 deletion releases/8.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ JavaScript:

- `ensure_userprofile_exists()` was removed from the `Tile` model.

- The following fields are no longer nullable. If you have custom SQL (or Python code that uses direct ORM operations to bypass model methods, etc.), you will need to set these fields directly on creation:
- The following fields are no longer nullable. If you have custom SQL (or Python code that uses direct ORM operations to bypass model `save()`, etc.), you will need to set these fields directly on creation:
- `Node.alias`
- `TileModel.data`

- The following fields implemented [`related_name`](https://docs.djangoproject.com/en/stable/ref/models/fields/#django.db.models.ForeignKey.related_name) and [`related_query_name`](https://docs.djangoproject.com/en/stable/ref/models/fields/#django.db.models.ForeignKey.related_query_name) to improve upon the Django-supplied defaults:
- `NodeGroup.parentnodegroup`
Expand Down

0 comments on commit 774e857

Please sign in to comment.