api endpoints fix and inclusion
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'add_profile_photo_and_likes'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
def upgrade():
|
||||
# photo_url
|
||||
with op.batch_alter_table('profiles', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('photo_url', sa.String(), nullable=True))
|
||||
|
||||
# likes
|
||||
op.create_table(
|
||||
'profile_likes',
|
||||
sa.Column('liker_user_id', sa.String(), primary_key=True),
|
||||
sa.Column('target_user_id', sa.String(), primary_key=True),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
)
|
||||
op.create_unique_constraint('uq_profile_like', 'profile_likes', ['liker_user_id', 'target_user_id'])
|
||||
|
||||
def downgrade():
|
||||
op.drop_constraint('uq_profile_like', 'profile_likes', type_='unique')
|
||||
op.drop_table('profile_likes')
|
||||
with op.batch_alter_table('profiles', schema=None) as batch_op:
|
||||
batch_op.drop_column('photo_url')
|
||||
Reference in New Issue
Block a user