Chapeter 8

This commit is contained in:
2023-06-04 01:00:41 +02:00
parent 8c1df34587
commit d81f038422
8 changed files with 245 additions and 4 deletions

View 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 ###