diff --git a/alembic/versions/20241210_d3aaeb6a9e6b_create_selectedbooks.py b/alembic/versions/20241210_d3aaeb6a9e6b_create_selectedbooks.py index 261a14983..648b05cc1 100644 --- a/alembic/versions/20241210_d3aaeb6a9e6b_create_selectedbooks.py +++ b/alembic/versions/20241210_d3aaeb6a9e6b_create_selectedbooks.py @@ -5,33 +5,40 @@ Create Date: 2024-12-10 14:16:32.223456+00:00 """ -from alembic import op import sqlalchemy as sa +from alembic import op # revision identifiers, used by Alembic. -revision = 'd3aaeb6a9e6b' -down_revision = 'b28ac9090d40' +revision = "d3aaeb6a9e6b" +down_revision = "b28ac9090d40" branch_labels = None depends_on = None def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.create_table('selected_books', - sa.Column('id', sa.Integer()), - sa.Column('patron_id', sa.Integer()), - sa.Column('work_id', sa.Integer()), - sa.Column('creation_date', sa.DateTime(timezone=True)), - sa.ForeignKeyConstraint(['patron_id'], ['patrons.id'], ), - sa.ForeignKeyConstraint(['work_id'], ['works.id'], ), - sa.PrimaryKeyConstraint('id'), - sa.UniqueConstraint('patron_id', 'work_id') + op.create_table( + "selected_books", + sa.Column("id", sa.Integer()), + sa.Column("patron_id", sa.Integer()), + sa.Column("work_id", sa.Integer()), + sa.Column("creation_date", sa.DateTime(timezone=True)), + sa.ForeignKeyConstraint( + ["patron_id"], + ["patrons.id"], + ), + sa.ForeignKeyConstraint( + ["work_id"], + ["works.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("patron_id", "work_id"), ) # ### end Alembic commands ### def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.drop_table('selected_books') + op.drop_table("selected_books") # ### end Alembic commands ###