From 794eb7456c8aa6ee3dc1752ba9d3a2d7609395c3 Mon Sep 17 00:00:00 2001 From: scammo Date: Mon, 11 Oct 2021 18:42:20 +0200 Subject: [PATCH] server_default boolean --- migrations/versions/459520b01f34_.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migrations/versions/459520b01f34_.py b/migrations/versions/459520b01f34_.py index 23fabc6..a4e78d1 100644 --- a/migrations/versions/459520b01f34_.py +++ b/migrations/versions/459520b01f34_.py @@ -7,6 +7,7 @@ Create Date: 2021-10-03 14:45:30.389359 """ from alembic import op import sqlalchemy as sa +from sqlalchemy.sql import expression # revision identifiers, used by Alembic. @@ -20,7 +21,7 @@ def upgrade(): # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table("profile") as batch_op: batch_op.alter_column('availability', new_column_name='availability_text') - batch_op.add_column(sa.Column('availability_status', sa.Boolean(), nullable=False)) + batch_op.add_column(sa.Column('availability_status', sa.Boolean(), server_default=expression.true(), nullable=False)) batch_op.add_column(sa.Column('availability_hours_per_week', sa.Integer(), nullable=True)) # ### end Alembic commands ###