pyfedi/migrations/versions/5487a1886c62_user_follower.py

38 lines
1.1 KiB
Python
Raw Permalink Normal View History

"""user_follower
Revision ID: 5487a1886c62
Revises: 46c170499e71
Create Date: 2024-04-29 15:55:33.954059
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5487a1886c62'
down_revision = '46c170499e71'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('user_follower',
sa.Column('local_user_id', sa.Integer(), nullable=False),
sa.Column('remote_user_id', sa.Integer(), nullable=False),
sa.Column('is_accepted', sa.Boolean(), nullable=True),
sa.Column('is_inward', sa.Boolean(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['local_user_id'], ['user.id'], ),
sa.ForeignKeyConstraint(['remote_user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('local_user_id', 'remote_user_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('user_follower')
# ### end Alembic commands ###