From 1cf6228b435861d6330c52d738f1b5da37bf75ec Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Fri, 3 Jul 2026 18:03:37 +0200 Subject: [PATCH] Drop broken billing playcount unique constraint --- ...rop_billing_playcount_unique_constraint.py | 24 +++++++++++++++++++ core/data/schema/arcade.py | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 core/data/alembic/versions/63f1fc2e334c_drop_billing_playcount_unique_constraint.py diff --git a/core/data/alembic/versions/63f1fc2e334c_drop_billing_playcount_unique_constraint.py b/core/data/alembic/versions/63f1fc2e334c_drop_billing_playcount_unique_constraint.py new file mode 100644 index 0000000..fda1a6f --- /dev/null +++ b/core/data/alembic/versions/63f1fc2e334c_drop_billing_playcount_unique_constraint.py @@ -0,0 +1,24 @@ +"""drop billing playcount unique constraint + +Revision ID: 63f1fc2e334c +Revises: ada3e2d02483 +Create Date: 2026-07-03 18:01:52.160242 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '63f1fc2e334c' +down_revision = 'ada3e2d02483' +branch_labels = None +depends_on = None + + +def upgrade(): + op.drop_constraint('machine', 'machine_billing_playcount', type_='unique') + + +def downgrade(): + op.create_unique_constraint('machine', 'machine_billing_playcount', ['machine']) diff --git a/core/data/schema/arcade.py b/core/data/schema/arcade.py index d587f71..f10f4cc 100644 --- a/core/data/schema/arcade.py +++ b/core/data/schema/arcade.py @@ -142,7 +142,7 @@ billing_playct: Table = Table( "machine", Integer, ForeignKey("machine.id", ondelete="cascade", onupdate="cascade"), - nullable=False, unique=True + nullable=False ), Column("game_id", CHAR(5), nullable=False), Column("year", INTEGER, nullable=False),