collapse migrations: 41 epic + 20 lyric + 12 applets + others → fresh initials + 4 themed seeds
- Delete all incremental migration files across all apps; regenerate 0001_initial.py per app via makemigrations (schema unchanged, no model edits) - applets/0003_seed_applets.py: all 20 Applet rows in one migration - epic/0003_seed_fiorentine_deck.py: Fiorentine Minchiate DeckVariant + 78 cards - epic/0004_seed_earthman_deck.py: Earthman DeckVariant + 50 major + 56 minor/middle arcana (106 cards); stray PENTACLES courts absent — clean from the start - epic/0005_seed_astro_reference_tables.py: 12 signs, 10 planets, 9 aspect types (incl. Semisquare + Sesquiquadrate), 12 house labels - 706 ITs green on fresh DB Code architected by Disco DeDisco <discodedisco@outlook.com> Git commit message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import django.db.models.deletion
|
||||
# Generated by Django 6.0 on 2026-04-28 00:59
|
||||
|
||||
from django.conf import settings
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
@@ -17,7 +18,7 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('slug', models.SlugField(unique=True)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('context', models.CharField(choices=[('dashboard', 'Dashboard'), ('gameboard', 'Gameboard')], default='dashboard', max_length=20)),
|
||||
('context', models.CharField(choices=[('dashboard', 'Dashboard'), ('gameboard', 'Gameboard'), ('wallet', 'Wallet'), ('billboard', 'Billboard')], default='dashboard', max_length=20)),
|
||||
('default_visible', models.BooleanField(default=True)),
|
||||
('grid_cols', models.PositiveSmallIntegerField(default=12)),
|
||||
('grid_rows', models.PositiveSmallIntegerField(default=3)),
|
||||
@@ -29,8 +30,6 @@ class Migration(migrations.Migration):
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('visible', models.BooleanField(default=True)),
|
||||
('applet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='applets.applet')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_applets', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={'unique_together': {('user', 'applet')}},
|
||||
),
|
||||
]
|
||||
|
||||
27
src/apps/applets/migrations/0002_initial.py
Normal file
27
src/apps/applets/migrations/0002_initial.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# Generated by Django 6.0 on 2026-04-28 00:59
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('applets', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='userapplet',
|
||||
name='user',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_applets', to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='userapplet',
|
||||
unique_together={('user', 'applet')},
|
||||
),
|
||||
]
|
||||
@@ -1,29 +0,0 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def seed_applets(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
for slug, name, cols, rows, context in [
|
||||
('wallet', 'Wallet', 12, 3, 'dashboard'),
|
||||
('new-list', 'New List', 9, 3, 'dashboard'),
|
||||
('my-lists', 'My Lists', 3, 3, 'dashboard'),
|
||||
('username', 'Username', 6, 3, 'dashboard'),
|
||||
('palette', 'Palette', 6, 3, 'dashboard'),
|
||||
('new-game', 'New Game', 4, 2, 'gameboard'),
|
||||
('my-games', 'My Games', 4, 4, 'gameboard'),
|
||||
('game-kit', 'Game Kit', 4, 2, 'gameboard'),
|
||||
]:
|
||||
Applet.objects.get_or_create(
|
||||
slug=slug,
|
||||
defaults={'name': name, 'grid_cols': cols, 'grid_rows': rows, 'context': context},
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('applets', '0001_initial')
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(seed_applets, migrations.RunPython.noop)
|
||||
]
|
||||
47
src/apps/applets/migrations/0003_seed_applets.py
Normal file
47
src/apps/applets/migrations/0003_seed_applets.py
Normal file
@@ -0,0 +1,47 @@
|
||||
"""Seed all Applet rows."""
|
||||
from django.db import migrations
|
||||
|
||||
APPLETS = [
|
||||
# (slug, name, context, default_visible, grid_cols, grid_rows)
|
||||
('wallet', 'Wallet', 'dashboard', True, 12, 3),
|
||||
('new-post', 'New Post', 'billboard', True, 9, 3),
|
||||
('my-posts', 'My Posts', 'billboard', True, 3, 3),
|
||||
('username', 'Username', 'dashboard', True, 6, 3),
|
||||
('palette', 'Palette', 'dashboard', True, 6, 3),
|
||||
('new-game', 'New Game', 'gameboard', True, 4, 3),
|
||||
('my-games', 'My Games', 'gameboard', True, 4, 4),
|
||||
('game-kit', 'Game Kit', 'gameboard', True, 4, 3),
|
||||
('wallet-balances', 'Wallet Balances', 'wallet', True, 3, 3),
|
||||
('wallet-tokens', 'Wallet Tokens', 'wallet', True, 3, 3),
|
||||
('wallet-payment', 'Payment Methods', 'wallet', True, 6, 3),
|
||||
('billboard-my-scrolls', 'My Scrolls', 'billboard', True, 4, 3),
|
||||
('billboard-my-contacts', 'Contacts', 'billboard', True, 4, 3),
|
||||
('billboard-most-recent', 'Most Recent', 'billboard', True, 8, 6),
|
||||
('gk-trinkets', 'Trinkets', 'game-kit', True, 3, 3),
|
||||
('gk-tokens', 'Tokens', 'game-kit', True, 3, 3),
|
||||
('gk-decks', 'Card Decks', 'game-kit', True, 3, 3),
|
||||
('gk-dice', 'Dice Sets', 'game-kit', True, 3, 3),
|
||||
('my-sky', 'My Sky', 'dashboard', True, 6, 6),
|
||||
('billboard-notes', 'My Notes', 'billboard', True, 4, 4),
|
||||
]
|
||||
|
||||
|
||||
def seed(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
for slug, name, context, default_visible, grid_cols, grid_rows in APPLETS:
|
||||
Applet.objects.create(
|
||||
slug=slug, name=name, context=context,
|
||||
default_visible=default_visible,
|
||||
grid_cols=grid_cols, grid_rows=grid_rows,
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('applets', '0002_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(seed, migrations.RunPython.noop),
|
||||
]
|
||||
@@ -1,37 +0,0 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def seed_wallet_applets(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
for slug, name, cols, rows in [
|
||||
('wallet-balances', 'Wallet Balances', 3, 3),
|
||||
('wallet-tokens', 'Wallet Tokens', 3, 3),
|
||||
('wallet-payment', 'Payment Methods', 6, 2),
|
||||
]:
|
||||
Applet.objects.get_or_create(
|
||||
slug=slug,
|
||||
defaults={'name': name, 'grid_cols': cols, 'grid_rows': rows, 'context': 'wallet'},
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('applets', '0002_seed_applets'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='applet',
|
||||
name='context',
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
('dashboard', 'Dashboard'),
|
||||
('gameboard', 'Gameboard'),
|
||||
('wallet', 'Wallet'),
|
||||
],
|
||||
default='dashboard',
|
||||
max_length=20,
|
||||
),
|
||||
),
|
||||
migrations.RunPython(seed_wallet_applets, migrations.RunPython.noop),
|
||||
]
|
||||
@@ -1,24 +0,0 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def rename_list_slugs(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
Applet.objects.filter(slug='new-list').update(slug='new-note', name='New Note')
|
||||
Applet.objects.filter(slug='my-lists').update(slug='my-notes', name='My Notes')
|
||||
|
||||
|
||||
def reverse_rename_list_slugs(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
Applet.objects.filter(slug='new-note').update(slug='new-list', name='New List')
|
||||
Applet.objects.filter(slug='my-notes').update(slug='my-lists', name='My Lists')
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('applets', '0003_wallet_applets'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(rename_list_slugs, reverse_rename_list_slugs),
|
||||
]
|
||||
@@ -1,24 +0,0 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def increase_gameboard_applet_heights(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
Applet.objects.filter(slug__in=['new-game', 'game-kit', 'wallet-payment']).update(grid_rows=3)
|
||||
|
||||
|
||||
def revert_gameboard_applet_heights(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
Applet.objects.filter(slug__in=['new-game', 'game-kit', 'wallet-payment']).update(grid_rows=2)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('applets', '0004_rename_list_applet_slugs')
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
increase_gameboard_applet_heights,
|
||||
revert_gameboard_applet_heights,
|
||||
)
|
||||
]
|
||||
@@ -1,48 +0,0 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def seed_billboard_applets(apps, schema_editor):
|
||||
Applet = apps.get_model("applets", "Applet")
|
||||
for slug, name, cols, rows in [
|
||||
("billboard-my-scrolls", "My Scrolls", 4, 3),
|
||||
("billboard-my-contacts", "Contacts", 4, 3),
|
||||
("billboard-most-recent", "Most Recent", 8, 6),
|
||||
]:
|
||||
Applet.objects.get_or_create(
|
||||
slug=slug,
|
||||
defaults={"name": name, "grid_cols": cols, "grid_rows": rows, "context": "billboard"},
|
||||
)
|
||||
|
||||
|
||||
def remove_billboard_applets(apps, schema_editor):
|
||||
Applet = apps.get_model("applets", "Applet")
|
||||
Applet.objects.filter(slug__in=[
|
||||
"billboard-my-scrolls",
|
||||
"billboard-my-contacts",
|
||||
"billboard-most-recent",
|
||||
]).delete()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("applets", "0005_gameboard_applet_heights"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="applet",
|
||||
name="context",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("dashboard", "Dashboard"),
|
||||
("gameboard", "Gameboard"),
|
||||
("wallet", "Wallet"),
|
||||
("billboard", "Billboard"),
|
||||
],
|
||||
default="dashboard",
|
||||
max_length=20,
|
||||
),
|
||||
),
|
||||
migrations.RunPython(seed_billboard_applets, remove_billboard_applets),
|
||||
]
|
||||
@@ -1,29 +0,0 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def fix_billboard_applets(apps, schema_editor):
|
||||
Applet = apps.get_model("applets", "Applet")
|
||||
# billboard-scroll belongs only to the billscroll page template, not the grid
|
||||
Applet.objects.filter(slug="billboard-scroll").delete()
|
||||
# Rename "My Contacts" → "Contacts"
|
||||
Applet.objects.filter(slug="billboard-my-contacts").update(name="Contacts")
|
||||
|
||||
|
||||
def reverse_fix_billboard_applets(apps, schema_editor):
|
||||
Applet = apps.get_model("applets", "Applet")
|
||||
Applet.objects.get_or_create(
|
||||
slug="billboard-scroll",
|
||||
defaults={"name": "Billscroll", "grid_cols": 12, "grid_rows": 6, "context": "billboard"},
|
||||
)
|
||||
Applet.objects.filter(slug="billboard-my-contacts").update(name="My Contacts")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("applets", "0006_billboard_applets"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(fix_billboard_applets, reverse_fix_billboard_applets),
|
||||
]
|
||||
@@ -1,25 +0,0 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def seed_game_kit_applets(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
for slug, name in [
|
||||
('gk-trinkets', 'Trinkets'),
|
||||
('gk-tokens', 'Tokens'),
|
||||
('gk-decks', 'Card Decks'),
|
||||
('gk-dice', 'Dice Sets'),
|
||||
]:
|
||||
Applet.objects.get_or_create(
|
||||
slug=slug,
|
||||
defaults={'name': name, 'grid_cols': 3, 'grid_rows': 3, 'context': 'game-kit'},
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('applets', '0007_fix_billboard_applets'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(seed_game_kit_applets, migrations.RunPython.noop)
|
||||
]
|
||||
@@ -1,24 +0,0 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def seed_my_sky_applet(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
Applet.objects.get_or_create(
|
||||
slug='my-sky',
|
||||
defaults={
|
||||
'name': 'My Sky',
|
||||
'grid_cols': 6,
|
||||
'grid_rows': 6,
|
||||
'context': 'dashboard',
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('applets', '0008_game_kit_applets'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(seed_my_sky_applet, migrations.RunPython.noop)
|
||||
]
|
||||
@@ -1,25 +0,0 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def seed_recognition_applet(apps, schema_editor):
|
||||
Applet = apps.get_model("applets", "Applet")
|
||||
Applet.objects.get_or_create(
|
||||
slug="billboard-recognition",
|
||||
defaults={
|
||||
"name": "Recognition",
|
||||
"grid_cols": 4,
|
||||
"grid_rows": 4,
|
||||
"context": "billboard",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("applets", "0009_my_sky_applet"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(seed_recognition_applet, migrations.RunPython.noop),
|
||||
]
|
||||
@@ -1,24 +0,0 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def rename_note_applets_to_post(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
Applet.objects.filter(slug='new-note').update(slug='new-post', name='New Post', context='billboard')
|
||||
Applet.objects.filter(slug='my-notes').update(slug='my-posts', name='My Posts', context='billboard')
|
||||
|
||||
|
||||
def reverse_rename_note_applets_to_post(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
Applet.objects.filter(slug='new-post').update(slug='new-note', name='New Note', context='dashboard')
|
||||
Applet.objects.filter(slug='my-posts').update(slug='my-notes', name='My Notes', context='dashboard')
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('applets', '0010_recognition_applet'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(rename_note_applets_to_post, reverse_rename_note_applets_to_post),
|
||||
]
|
||||
@@ -1,31 +0,0 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def rename_recognition_applet_to_notes(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
Applet.objects.filter(slug='billboard-recognition').update(
|
||||
slug='billboard-notes',
|
||||
name='My Notes',
|
||||
)
|
||||
|
||||
|
||||
def reverse_rename_recognition_applet_to_notes(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
Applet.objects.filter(slug='billboard-notes').update(
|
||||
slug='billboard-recognition',
|
||||
name='Recognition',
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('applets', '0011_rename_note_applets_to_post'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
rename_recognition_applet_to_notes,
|
||||
reverse_rename_recognition_applet_to_notes,
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user