Why isn't sqlalchemy's default column value working

后端 未结 1 1211
抹茶落季
抹茶落季 2020-12-31 00:17

I am using Postgresql 9.1 and SQLAlchemy 0.9.

The problem is, \'default=10\' doesn\'t work.

My Code:

conn_str = \'p         


        
相关标签:
1条回答
  • 2020-12-31 00:37

    instead of using default, use server_default... fixed the problem for me https://docs.sqlalchemy.org/en/latest/core/defaults.html?highlight=schema%20column#sqlalchemy.schema.ColumnDefault

    0 讨论(0)
提交回复
热议问题