Link Accounting Mirror metadata and Tally paths to Client FY

This commit is contained in:
A R R R Associates
2026-09-20 14:59:14 +05:30
parent 827231a135
commit 0e12ccfe4e
8 changed files with 318 additions and 171 deletions
@@ -0,0 +1,46 @@
"""Store Accounting Mirror and Tally working paths in Client/FY mirror metadata.
Revision ID: 20260920_accounting_mirror_paths
Revises: 20260918_accounting_mirror_ver
"""
from alembic import op
import sqlalchemy as sa
revision = "20260920_accounting_mirror_paths"
down_revision = "20260918_accounting_mirror_ver"
branch_labels = None
depends_on = None
def upgrade() -> None:
bind = op.get_bind()
inspector = sa.inspect(bind)
columns = {c["name"] for c in inspector.get_columns("accounting_mirror_registry")}
if "mirror_local_path" not in columns:
op.add_column(
"accounting_mirror_registry",
sa.Column("mirror_local_path", sa.String(length=2000), nullable=False, server_default=""),
)
if "tally_data_relative_path" not in columns:
op.add_column(
"accounting_mirror_registry",
sa.Column("tally_data_relative_path", sa.String(length=1000), nullable=False, server_default=""),
)
if "tally_data_local_path" not in columns:
op.add_column(
"accounting_mirror_registry",
sa.Column("tally_data_local_path", sa.String(length=2000), nullable=False, server_default=""),
)
def downgrade() -> None:
bind = op.get_bind()
inspector = sa.inspect(bind)
columns = {c["name"] for c in inspector.get_columns("accounting_mirror_registry")}
if "tally_data_local_path" in columns:
op.drop_column("accounting_mirror_registry", "tally_data_local_path")
if "tally_data_relative_path" in columns:
op.drop_column("accounting_mirror_registry", "tally_data_relative_path")
if "mirror_local_path" in columns:
op.drop_column("accounting_mirror_registry", "mirror_local_path")