"""add caching for latest version in Document_Language

Revision ID: 5c67abd3b371
Revises: 45620002ae0d
Create Date: 2024-05-04 16:58:50.534885

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5c67abd3b371'
down_revision = '45620002ae0d'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('document_language', sa.Column('latest_version_id', sa.Integer(), nullable=False))
    op.create_foreign_key(None, 'document_language', 'document_version', ['latest_version_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'document_language', type_='foreignkey')
    op.drop_column('document_language', 'latest_version_id')
    # ### end Alembic commands ###
