sqlalchemy - Alembic default value to be used in add_column -


how alembic use specified default value new column, without making server_default?

only existing rows should receive default value. new rows inserted after should still server_default.

i had similar problem, wanted new column not nullable, not work existing rows, of course. created row without not null constraint first, filled column custom python code , altered column (in same migration) have constraint.

so you'd iterate on existing objects, set values according transient default.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -