python - SQLAlchemy Migrate - Can I add (or modify) a column to a certain position of an existing table? -
i want add column position of existing table or move 1 of columns. can't find method in sqlalchemy-migrate.
i want know methods equivalent following mysql queries in sqlalchemy-migrate
alter table tablename add column_name2 int after column_name1 alter table tablename add column_name2 int first alter table tablename modify column column_name2 int after column_name1;
you need follow below steps:
- create temp table,
- copy records in temp table
- rename temp original table.
during alter operation flow well, these operation executed internally.
Comments
Post a Comment