Files
romm/backend/alembic/versions/0099_platform_description.py
Spinnich 98e8ae7599 feat(platforms): add editable platform descriptions
Custom platforms could only be distinguished by name, which is often not
enough context (e.g. a "Sega - Genesis/Mega Drive (Unofficial)" folder
holding aftermarket and unlicensed dumps). Platforms now carry an
optional free-text description, mirroring collections.

The column is nullable and defaults to "", matching custom_name, so a
rescan (which merges a freshly scanned Platform over the existing row)
leaves it untouched. update_platform patches only the fields sent, so an
omitted description is preserved and an empty string clears it.

Surfaced in the v2 UI only: the Settings tab name form now covers both
custom_name and description, and PlatformHead renders the description as
a chip alongside the metadata chips. v1 is frozen and gets no new UI, but
round-trips the field unchanged through the shared API service.

Closes #3402

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 19:00:30 +00:00

30 lines
716 B
Python

"""Add description to platforms so custom platforms can carry context
beyond their name (mirrors collections.description).
Revision ID: 0099_platform_description
Revises: 0098_generated_metadata_columns
Create Date: 2026-07-20 00:00:00.000000
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "0099_platform_description"
down_revision = "0098_generated_metadata_columns"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column(
"platforms",
sa.Column("description", sa.Text(), nullable=True),
if_not_exists=True,
)
def downgrade() -> None:
op.drop_column("platforms", "description", if_exists=True)