"""Add corpus follower associations table

Revision ID: 5fe6a6c7870c
Revises: 5b2a6e590166
Create Date: 2023-01-23 08:27:10.169454

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5fe6a6c7870c'
down_revision = '5b2a6e590166'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('corpus_follower_associations',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('following_user_id', sa.Integer(), nullable=True),
    sa.Column('followed_corpus_id', sa.Integer(), nullable=True),
    sa.Column('permissions', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['followed_corpus_id'], ['corpora.id'], ),
    sa.ForeignKeyConstraint(['following_user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('corpus_follower_associations')
    # ### end Alembic commands ###