diff options
-rw-r--r-- | fietsboek/alembic/versions/20230830_8f4e4eae5eb2.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/fietsboek/alembic/versions/20230830_8f4e4eae5eb2.py b/fietsboek/alembic/versions/20230830_8f4e4eae5eb2.py new file mode 100644 index 0000000..c6abf33 --- /dev/null +++ b/fietsboek/alembic/versions/20230830_8f4e4eae5eb2.py @@ -0,0 +1,32 @@ +"""add favourite association table + +Revision ID: 8f4e4eae5eb2 +Revises: 3149aa2d0114 +Create Date: 2023-08-30 19:19:54.545517 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '8f4e4eae5eb2' +down_revision = '3149aa2d0114' +branch_labels = None +depends_on = None + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('track_favourite_assoc', + sa.Column('track_id', sa.Integer(), nullable=False), + sa.Column('user_id', sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(['track_id'], ['tracks.id'], name=op.f('fk_track_favourite_assoc_track_id_tracks')), + sa.ForeignKeyConstraint(['user_id'], ['users.id'], name=op.f('fk_track_favourite_assoc_user_id_users')), + sa.PrimaryKeyConstraint('track_id', 'user_id', name=op.f('pk_track_favourite_assoc')) + ) + # ### end Alembic commands ### + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('track_favourite_assoc') + # ### end Alembic commands ### |