mirror of
https://github.com/rmontanana/microblog.git
synced 2025-08-17 08:15:52 +00:00
Chapeter 8
This commit is contained in:
33
migrations/versions/619062c0486b_followers.py
Normal file
33
migrations/versions/619062c0486b_followers.py
Normal file
@@ -0,0 +1,33 @@
|
||||
"""followers
|
||||
|
||||
Revision ID: 619062c0486b
|
||||
Revises: 680d311746e8
|
||||
Create Date: 2023-06-03 21:28:40.382514
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '619062c0486b'
|
||||
down_revision = '680d311746e8'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('followers',
|
||||
sa.Column('follower_id', sa.Integer(), nullable=True),
|
||||
sa.Column('followed_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['followed_id'], ['user.id'], ),
|
||||
sa.ForeignKeyConstraint(['follower_id'], ['user.id'], )
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('followers')
|
||||
# ### end Alembic commands ###
|
Reference in New Issue
Block a user