fix: shorten alembic revision name and expand version_num column
- Rename 2026_05_27_make_project_id_nullable to 2026_05_27_external_repos (33 chars exceeded VARCHAR(32) limit in alembic_version table) - Add alembic_version column expansion to VARCHAR(64) in migration - Ensure future migrations won't hit the 32 char limit
This commit is contained in:
+7
-3
@@ -1,7 +1,7 @@
|
|||||||
"""make_project_id_nullable_in_git_repositories
|
"""make_project_id_nullable_in_git_repositories
|
||||||
|
|
||||||
Revision ID: 2026_05_27_make_project_id_nullable
|
Revision ID: 2026_05_27_external_repos
|
||||||
Revises: e7adfb4
|
Revises: 2026_05_26_add_git_mounts
|
||||||
Create Date: 2026-05-27 08:30:00.000000
|
Create Date: 2026-05-27 08:30:00.000000
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -12,13 +12,16 @@ import sqlalchemy as sa
|
|||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision: str = "2026_05_27_make_project_id_nullable"
|
revision: str = "2026_05_27_external_repos"
|
||||||
down_revision: Union[str, Sequence[str], None] = "2026_05_26_add_git_mounts"
|
down_revision: Union[str, Sequence[str], None] = "2026_05_26_add_git_mounts"
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
|
# Expand alembic_version version_num to avoid truncation errors
|
||||||
|
op.execute("ALTER TABLE alembic_version ALTER COLUMN version_num TYPE VARCHAR(64)")
|
||||||
|
|
||||||
# Make project_id nullable to allow external repositories
|
# Make project_id nullable to allow external repositories
|
||||||
op.alter_column(
|
op.alter_column(
|
||||||
"git_repositories",
|
"git_repositories",
|
||||||
@@ -35,3 +38,4 @@ def downgrade() -> None:
|
|||||||
existing_type=sa.UUID(),
|
existing_type=sa.UUID(),
|
||||||
nullable=False,
|
nullable=False,
|
||||||
)
|
)
|
||||||
|
op.execute("ALTER TABLE alembic_version ALTER COLUMN version_num TYPE VARCHAR(32)")
|
||||||
Reference in New Issue
Block a user