feat: Update docker-compose configuration to use environment variables for sensitive data, enhance testing documentation with new LaTeX files for capacity planning, and refine README for clarity on compilation and testing processes.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
"""Add nit and object_key to count_job_files for MinIO download bridge.
|
||||
|
||||
Revision ID: 0005
|
||||
Revises: 0004
|
||||
Create Date: 2026-07-17
|
||||
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision: str = "0005"
|
||||
down_revision: Union[str, None] = "0004"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def _column_exists(conn: sa.engine.Connection, table: str, column: str) -> bool:
|
||||
cols = {c["name"] for c in sa.inspect(conn).get_columns(table)}
|
||||
return column in cols
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
conn = op.get_bind()
|
||||
if not sa.inspect(conn).has_table("count_job_files"):
|
||||
return
|
||||
if not _column_exists(conn, "count_job_files", "nit"):
|
||||
op.add_column("count_job_files", sa.Column("nit", sa.String(255), nullable=True))
|
||||
op.create_index("ix_count_job_files_nit", "count_job_files", ["nit"])
|
||||
if not _column_exists(conn, "count_job_files", "object_key"):
|
||||
op.add_column("count_job_files", sa.Column("object_key", sa.Text(), nullable=True))
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
conn = op.get_bind()
|
||||
if not sa.inspect(conn).has_table("count_job_files"):
|
||||
return
|
||||
if _column_exists(conn, "count_job_files", "object_key"):
|
||||
op.drop_column("count_job_files", "object_key")
|
||||
if _column_exists(conn, "count_job_files", "nit"):
|
||||
op.drop_index("ix_count_job_files_nit", table_name="count_job_files")
|
||||
op.drop_column("count_job_files", "nit")
|
||||
Reference in New Issue
Block a user