[Fixed]-Django DB level default value for a column

13👍

There is an open ticket 470 to include default values in the SQL schema.

Until this feature has been added to Django, you’ll have to manually run alter table statements yourself or write a migration to run them if you want a default value in the SQL schema.

Note that Django allows callables as defaults, so even if this feature is added to Django, it won’t be possible to have all defaults in the database.

Leave a comment