django south migration, doesnt set default

前端 未结 3 1366
野的像风
野的像风 2021-02-08 10:57

I use south to migrate my django models. There is however a nasty bug in south. It doesn\'t set default values in Postgres Databases. Example:

created_at = model         


        
3条回答
  •  一生所求
    2021-02-08 11:27

    This is not a bug, in South or elsewhere.

    I think you are confused about how default values work in Django generally. Django does not set default values in the database schema. It applies them directly in Python, when a new instance is created. You can verify this by doing manage.py sqlall and see that the generated SQL does not contain default attributes.

提交回复
热议问题