0

Done as follows but no column is added.

Migrate database

python manage.py db migrate

Edit migrations/versions/{version}_.py

def upgrade():
    from alembic import op
    op.add_column('table_name', Column('column_name', INTEGER) )

Update schema

python manage.py db upgrade

user
  • 1,220
  • 1
  • 12
  • 31

1 Answers1

0

The reason is that alembic stores version in table called alembic_version, and once {version} is in alembic_version, then nothing happens. The solution is to create a new migration script and do migrate again.

user
  • 1,220
  • 1
  • 12
  • 31