took db-breaking migrations change out of 0003 and placed into new migration 0005 (grid_cols, grid_rows)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Disco DeDisco
2026-03-06 19:22:30 -05:00
parent 9aea1ccb56
commit 86e70b7256
2 changed files with 17 additions and 2 deletions

View File

@@ -3,8 +3,8 @@ from django.db import migrations
def seed_applets(apps, schema_editor): def seed_applets(apps, schema_editor):
Applet = apps.get_model("dashboard", "Applet") Applet = apps.get_model("dashboard", "Applet")
Applet.objects.get_or_create(slug="username", defaults={"name": "Username"}, grid_cols=6, grid_rows=3) Applet.objects.get_or_create(slug="username", defaults={"name": "Username"})
Applet.objects.get_or_create(slug="palette", defaults={"name": "Palette"}, grid_cols=6, grid_rows=3) Applet.objects.get_or_create(slug="palette", defaults={"name": "Palette"})
class Migration(migrations.Migration): class Migration(migrations.Migration):

View File

@@ -0,0 +1,15 @@
from django.db import migrations
def set_grid_defaults(apps, schema_editor):
Applet = apps.get_model("dashboard", "Applet")
Applet.objects.filter(slug__in=["username", "palette"]).update(grid_cols=6, grid_rows=3)
class Migration(migrations.Migration):
dependencies = [
("dashboard", "0004_applet_grid_cols_applet_grid_rows"),
]
operations = [
migrations.RunPython(set_grid_defaults, migrations.RunPython.noop),
]