refac: deprecate peewee migration layer

The Alembic init migration (7e5b5dc7342b) already creates the
equivalent schema. Peewee migrations are no longer needed for
any version >= 0.3.6.
This commit is contained in:
Timothy Jaeryang Baek
2026-05-12 03:45:59 +09:00
parent 4527c747b4
commit 2c2d06c31b
23 changed files with 258 additions and 1674 deletions
+11 -8
View File
@@ -1,15 +1,18 @@
"""Alembic migration utilities."""
from alembic import op
from sqlalchemy import Inspector
from sqlalchemy import inspect as sa_inspect
def get_existing_tables():
con = op.get_bind()
inspector = Inspector.from_engine(con)
tables = set(inspector.get_table_names())
return tables
def get_existing_tables() -> set[str]:
"""Return the set of table names already present in the database."""
bind = op.get_bind()
inspector = sa_inspect(bind)
return set(inspector.get_table_names())
def get_revision_id():
def get_revision_id() -> str:
"""Generate a short random revision identifier."""
import uuid
return str(uuid.uuid4()).replace('-', '')[:12]
return uuid.uuid4().hex[:12]