mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 23:22:57 +01:00
38 lines
1.8 KiB
Python
38 lines
1.8 KiB
Python
"""update
|
|
|
|
Revision ID: b7b896502e8e
|
|
Revises:
|
|
Create Date: 2024-03-17 15:07:10.795935
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'b7b896502e8e'
|
|
down_revision: Union[str, None] = None
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint('document_department_association_department_id_fkey', 'document_department_association', type_='foreignkey')
|
|
op.drop_constraint('document_department_association_document_id_fkey', 'document_department_association', type_='foreignkey')
|
|
op.create_foreign_key(None, 'document_department_association', 'document', ['document_id'], ['id'], onupdate='CASCADE', ondelete='CASCADE')
|
|
op.create_foreign_key(None, 'document_department_association', 'departments', ['department_id'], ['id'], onupdate='CASCADE', ondelete='CASCADE')
|
|
# op.create_unique_constraint('unique_user_role', 'user_roles', ['user_id', 'role_id', 'company_id'])
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
# op.drop_constraint('unique_user_role', 'user_roles', type_='unique')
|
|
op.drop_constraint(None, 'document_department_association', type_='foreignkey')
|
|
op.drop_constraint(None, 'document_department_association', type_='foreignkey')
|
|
op.create_foreign_key('document_department_association_document_id_fkey', 'document_department_association', 'document', ['document_id'], ['id'])
|
|
op.create_foreign_key('document_department_association_department_id_fkey', 'document_department_association', 'departments', ['department_id'], ['id'])
|
|
# ### end Alembic commands ###
|