Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flask #db #upgrade #add #nullable #column
ADD COMMENT
Topic
Name
4+7 =