This completely removes the previous DB patching mechanism. When this is first run for an existing installation of Unwind, depending on its version it might lead to problems because the database's schema won't match the code. To avoid that issue, when upgrading Unwind to this version make sure to STOP the old application, install this new version but DON'T start it, instead use `alembic upgrade head` to run the outstanding patches, and only then start the application.
38 lines
954 B
Python
38 lines
954 B
Python
"""remove db_patches table
|
|
|
|
We replace our old patch process with Alembic's.
|
|
|
|
Revision ID: 8b06e4916840
|
|
Revises: f17c7ca9afa4
|
|
Create Date: 2024-05-19 00:11:06.730421+00:00
|
|
|
|
"""
|
|
|
|
from typing import Sequence
|
|
|
|
import sqlalchemy as sa
|
|
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "8b06e4916840"
|
|
down_revision: str | None = "f17c7ca9afa4"
|
|
branch_labels: str | Sequence[str] | None = None
|
|
depends_on: str | Sequence[str] | None = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table("db_patches")
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table(
|
|
"db_patches",
|
|
sa.Column("id", sa.INTEGER(), nullable=False),
|
|
sa.Column("current", sa.VARCHAR(), nullable=True),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
# ### end Alembic commands ###
|