2026-05-19 01:17:58 -05:00
|
|
|
"""Add max_agents field to boards.
|
|
|
|
|
|
|
|
|
|
Revision ID: 4c1f5e2a7b9d
|
|
|
|
|
Revises: c9d7e9b6a4f2
|
|
|
|
|
Create Date: 2026-02-14 00:00:00.000000
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
from alembic import op
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
|
|
|
revision = "4c1f5e2a7b9d"
|
feat(forgejo): add validation, cached issues, sync service, and human issue APIs (Issues 5-8); add connection and repository admin UI (Issues 3-4); fix migration graph and client bugs
Backend Issues 5-8:
- POST /forgejo/connections/{id}/validate and /repositories/{id}/validate
- ForgejoIssue model with unique constraint (repo_id, issue_number)
- IssueSyncService with pagination and upsert
- GET /forgejo/issues with filtering, search, pagination
- GET /forgejo/issues/{id} with org-scoped access
- Fixed ForgejoAPIClient /api/v1 path prefix
- Fixed get_forgejo_client async context (was async def, now regular def)
- Fixed Forgejo API response parsing (list, not dict with items)
- Fixed None-safe handling for labels/assignees
Frontend Issues 3-4:
- Connections list, new, edit pages with token masking
- Repositories list, new, edit pages with connection selector
- ForgejoConnectionForm, ForgejoConnectionsTable components
- ForgejoRepositoryForm, ForgejoRepositoriesTable components
- api-forgejo.ts client library
Migration cleanup:
- Consolidated forgejo_issues table into f5a2b3c4d5e6 migration
- Removed orphan branch migrations for already-existing tables
- Fixed migration graph to single head (f5a2b3c4d5e6)
- Stamped DB to correct revision
2026-05-19 03:10:32 -05:00
|
|
|
down_revision = "658dca8f4a11"
|
2026-05-19 01:17:58 -05:00
|
|
|
branch_labels = None
|
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade() -> None:
|
|
|
|
|
"""Add required boards.max_agents column with a safe backfill default."""
|
|
|
|
|
op.add_column(
|
|
|
|
|
"boards",
|
|
|
|
|
sa.Column(
|
|
|
|
|
"max_agents",
|
|
|
|
|
sa.Integer(),
|
|
|
|
|
nullable=False,
|
|
|
|
|
server_default=sa.text("1"),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
op.alter_column("boards", "max_agents", server_default=None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade() -> None:
|
|
|
|
|
"""Remove boards.max_agents column."""
|
|
|
|
|
op.drop_column("boards", "max_agents")
|