Answers for "flask db upgrade add new not nullable column"

0

flask db upgrade add new not nullable column

op.add_column('mytable', sa.Column(
    'mycolumn', 
    sa.String(), 
    nullable=False, 
    server_default='lorem ipsum', #  <---  add this
))
Posted by: Guest on August-05-2021
0

flask db upgrade add new not nullable column

def upgrade():
    op.add_column('my_table', sa.Column('my_column', sa.String()))
    op.execute('UPDATE my_table SET my_column=my_other_column')
    op.alter_column('my_table', 'my_column', nullable=False)
Posted by: Guest on August-05-2021

Code answers related to "flask db upgrade add new not nullable column"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language