server_default boolean
This commit is contained in:
parent
2387fb5e19
commit
794eb7456c
@ -7,6 +7,7 @@ Create Date: 2021-10-03 14:45:30.389359
|
|||||||
"""
|
"""
|
||||||
from alembic import op
|
from alembic import op
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
from sqlalchemy.sql import expression
|
||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
@ -20,7 +21,7 @@ def upgrade():
|
|||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
with op.batch_alter_table("profile") as batch_op:
|
with op.batch_alter_table("profile") as batch_op:
|
||||||
batch_op.alter_column('availability', new_column_name='availability_text')
|
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))
|
batch_op.add_column(sa.Column('availability_hours_per_week', sa.Integer(), nullable=True))
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user