aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2023-08-30 19:25:49 +0200
committerDaniel Schadt <kingdread@gmx.de>2023-08-30 19:25:49 +0200
commitf7b6ccdccc84d2d1653e9fcaf9fe3e66d6073a18 (patch)
tree5f33844b8af3c661ec185fcecaff37e72a45e84e
parent4cc160a29e625ce317d30237e3d9fe184bbb5a19 (diff)
downloadfietsboek-f7b6ccdccc84d2d1653e9fcaf9fe3e66d6073a18.tar.gz
fietsboek-f7b6ccdccc84d2d1653e9fcaf9fe3e66d6073a18.tar.bz2
fietsboek-f7b6ccdccc84d2d1653e9fcaf9fe3e66d6073a18.zip
add alembic migration for favourite table
-rw-r--r--fietsboek/alembic/versions/20230830_8f4e4eae5eb2.py32
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 ###