From 18204628cc52ecbb2a4b9e431843f0cfbb2bd1e3 Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Wed, 27 May 2026 10:36:47 +0200 Subject: [PATCH] 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 --- ...ect_id_nullable.py => 2026_05_27_external_repos.py} | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) rename apps/api/alembic/versions/{2026_05_27_make_project_id_nullable.py => 2026_05_27_external_repos.py} (68%) diff --git a/apps/api/alembic/versions/2026_05_27_make_project_id_nullable.py b/apps/api/alembic/versions/2026_05_27_external_repos.py similarity index 68% rename from apps/api/alembic/versions/2026_05_27_make_project_id_nullable.py rename to apps/api/alembic/versions/2026_05_27_external_repos.py index 11cca9d..e6b3395 100644 --- a/apps/api/alembic/versions/2026_05_27_make_project_id_nullable.py +++ b/apps/api/alembic/versions/2026_05_27_external_repos.py @@ -1,7 +1,7 @@ """make_project_id_nullable_in_git_repositories -Revision ID: 2026_05_27_make_project_id_nullable -Revises: e7adfb4 +Revision ID: 2026_05_27_external_repos +Revises: 2026_05_26_add_git_mounts Create Date: 2026-05-27 08:30:00.000000 """ @@ -12,13 +12,16 @@ import sqlalchemy as sa # 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" branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = 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 op.alter_column( "git_repositories", @@ -35,3 +38,4 @@ def downgrade() -> None: existing_type=sa.UUID(), nullable=False, ) + op.execute("ALTER TABLE alembic_version ALTER COLUMN version_num TYPE VARCHAR(32)")