I just pushed up my Flask app to my staging environment and I noticed that I now have a discrepancy between the two Postgres databases. My staging database has an id
column in the instance_tags
table while my local database does not.
Three migrations ago I added an id
column and then later removed it in models.py file. When it wasn't removing from my database, I ended up deleting it manually. I know, this is probably a bad thing! Anyway, my migration file looks like...
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('instance_tags',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('instance_id', sa.String(length=30), nullable=False),
sa.Column('tag_group', sa.String(length=50), nullable=True),
sa.Column('tag', sa.String(length=50), nullable=True),
sa.PrimaryKeyConstraint('id', 'instance_id', name=op.f('pk_instance_tags'))
)
What is the best approach to remove the id
column?
Thanks in advance for you help.