Using Alembic API from inside application code

前端 未结 8 913
夕颜
夕颜 2020-12-08 04:06

I am using SQLite as an application file format (see here for why you would want to do this) for my PySide-based desktop application. That is, when a user uses my app, their

8条回答
  •  Happy的楠姐
    2020-12-08 05:10

    See documentation of alembic.operations.base.Operations:

        from alembic.runtime.migration import MigrationContext
        from alembic.operations import Operations
    
        conn = myengine.connect()
        ctx = MigrationContext.configure(conn)
        op = Operations(ctx)
    
        op.alter_column("t", "c", nullable=True)
    

提交回复
热议问题