43 lines
1.5 KiB
Python
43 lines
1.5 KiB
Python
"""add default and nullability
|
|
|
|
Revision ID: c89d082850bd
|
|
Revises: 1c4e0a7d9612
|
|
Create Date: 2026-09-14 16:55:57.927185
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'c89d082850bd'
|
|
down_revision: Union[str, Sequence[str], None] = '1c4e0a7d9612'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.alter_column('financial_statement_meta', 'report_date',
|
|
existing_type=sa.DATE(),
|
|
nullable=True,
|
|
)
|
|
op.create_foreign_key('recognition_job_file_fk', 'recognition_job', 'stored_file', ['file_id'], ['id'], use_alter=True)
|
|
op.create_foreign_key('stored_file_recjob_fk', 'stored_file', 'recognition_job', ['current_recognition_job_id'], ['id'], use_alter=True)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint('stored_file_recjob_fk', 'stored_file', type_='foreignkey')
|
|
op.drop_constraint('recognition_job_file_fk', 'recognition_job', type_='foreignkey')
|
|
op.alter_column('financial_statement_meta', 'report_date',
|
|
existing_type=sa.DATE(),
|
|
nullable=False,
|
|
)
|
|
# ### end Alembic commands ###
|