fix: alembic migrations (#470)

* fix: alembic migrations

This commit fixes all the migrations that was half-backed, due to auto
creation in the db init before. The process was to checkout at the
commit where the migration was created, and use --autogenerate to
regenerate at the state of the migration. 4 migrations was fixed.

It also includes a workflow to ensure migration can applies correctly.

* fix: db migration check

* fix: nullable on meeting_consent

* fix: try fixing tests
This commit is contained in:
2025-06-27 12:03:10 -06:00
committed by GitHub
parent 9f70f76557
commit 3d370336cc
7 changed files with 174 additions and 188 deletions

View File

@@ -0,0 +1,46 @@
"""Add transcript table
Revision ID: b3df9681cae9
Revises: 543ed284d69a
Create Date: 2025-06-27 08:57:16.306940
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "b3df9681cae9"
down_revision: Union[str, None] = "543ed284d69a"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"transcript",
sa.Column("id", sa.String(), nullable=False),
sa.Column("name", sa.String(), nullable=True),
sa.Column("status", sa.String(), nullable=True),
sa.Column("locked", sa.Boolean(), nullable=True),
sa.Column("duration", sa.Integer(), nullable=True),
sa.Column("created_at", sa.DateTime(), nullable=True),
sa.Column("summary", sa.String(), nullable=True),
sa.Column("topics", sa.JSON(), nullable=True),
sa.Column("events", sa.JSON(), nullable=True),
sa.Column("source_language", sa.String(), nullable=True),
sa.Column("target_language", sa.String(), nullable=True),
sa.Column("user_id", sa.String(), nullable=True),
sa.PrimaryKeyConstraint("id"),
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("transcript")
# ### end Alembic commands ###