

> testing of migrations and to not run migrations at all in unit tests > direction of the contributor community is to be consistent around > databases that would be used in production. > Migrations should really not be run against SQLite at all - only on the It is recommended to use Alembic, which we briefly go over in Migrations. > 3) Add our own wrapper in savanna so that we have a drop_column() > open-source contributions for us, yay :) ) > 2) Extend alembic so that op.drop_column() does the right thing (more > 1) don't support migrations for sqlite (I think "no", but maybe) > How do we want to handle this? Three good options I can think of: > broken, too (I need to check what the migration test is doing). I am seeing the error (copied below) when trying to apply a column change (not null -> nullable) after a new table create, via this command: alembic upgrade. > The existing 002 migration uses op.drop_column(), so I'm assuming it's > excluding the column(s) you don't want and delete the old one, > To make this work with sqlite, you have to copy the table to a > doesn't support dropping a column (broken imho, but that's another > op.drop_column() doesn't work with sqlite.

> I was playing with alembic migration and discovered that > On Thu, at 14:51 -0500, Trevor McKay wrote: > Because, as a developer, when I see a sql error trace as the result of > "Database migrations are not supported for sqlite"

ALEMBIC SQLITE DROP COLUMN ERROR UPGRADE
Edit the file to drop the constraint: def upgrade (): op.dropconstraint ('nameofconstraint', 'tablename') def.

Create an empty migration file: flask db revision -m 'Drop unique constraint'.
ALEMBIC SQLITE DROP COLUMN ERROR MANUAL
But you can create a manual Alembic migration file to drop the constraint. > user for attempted migrations on unsupported platforms. Flask-Migrate, or rather Alembic, will not autodetect anonymous constraints. > that it checks the db connection info and throws a polite error to the > However, if that's the case then we need to fix up savanna-db-manage so > Okay, I can accept that migrations shouldn't be supported on sqlite. > On Fri, at 6:12 AM, Trevor McKay wrote: > Such check could be useful on alembic side too. On Fri, at 7:31 PM, Andrew Lazarev wrote: So before dropping support of migrations for sqlite & switching to modelīased created schema we should add tests that will check that model & Schema created by migration & models are same (actually they are not same). The major issue that we have now is that we are not able to ensure that DB Yep we shouldn't use migrations for sqlite at all. Next message: team meeting minutes Jan 30.Previous message: Alembic migrations and absence of DROP column in sqlite.This approach is a bit noisy (you need to define table manually), but it works.Alembic migrations and absence of DROP column in sqlite Boris Pavlovic bpavlovic at # now that all data is migrated we can just drop the old column The relevant point here is that there is data in _number_int that should be converted into _number_str like this: number_conv = įor item in connection.execute(model_lect()): _number_str = sa.Column('number_str', sa.String(length=30)) Should be after migration like this: class Model(_Base): _number_int = sa.Column('number_int', sa.Integer) Dec 1, 2012, 11:49:40 AM to I have 2 simple tables defined as below: class Test1 (Base): tablename 'test1' id Column (Integer, primarykey True) name. _oid = Column('oid', sa.Integer, primary_key=True) I want to add a new and drop an old column with the database-migation tool alembic. I have a sqlite3 database accessing it with SQLAlchemy in python3.
