mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 18:42:34 +01:00
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
"""Add hashes to roms
|
|
|
|
Revision ID: 0025_roms_hashes
|
|
Revises: 0024_sibling_roms_db_view
|
|
Create Date: 2024-08-11 21:50:53.301352
|
|
|
|
"""
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "0025_roms_hashes"
|
|
down_revision = "0024_sibling_roms_db_view"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
with op.batch_alter_table("roms", schema=None) as batch_op:
|
|
batch_op.add_column(
|
|
sa.Column("crc_hash", sa.String(length=100), nullable=True),
|
|
if_not_exists=True,
|
|
)
|
|
batch_op.add_column(
|
|
sa.Column("md5_hash", sa.String(length=100), nullable=True),
|
|
if_not_exists=True,
|
|
)
|
|
batch_op.add_column(
|
|
sa.Column("sha1_hash", sa.String(length=100), nullable=True),
|
|
if_not_exists=True,
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
with op.batch_alter_table("roms", schema=None) as batch_op:
|
|
batch_op.drop_column("sha1_hash", if_exists=True)
|
|
batch_op.drop_column("md5_hash", if_exists=True)
|
|
batch_op.drop_column("crc_hash", if_exists=True)
|