I am using Django models to create a PostgreSQL-DB. I have a DateTimeField where I would like to set the current timestamp as default value. I am aware of multiple sources suggesting how to do this. However, when I inspect my DB outside of Django, the default timestamp doesn't show up.
Approaches I have tried:
1.
created_at = models.DateTimeField(auto_now_add=True)
from django.db.models.functions import Now
...
created_at = models.DateTimeField(default=Now())
from django.utils.timezone import now
...
created_at = models.DateTimeField(default=now)
What I would expect is for the PostgreSQL database to show:
TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
What It shows is timestamp with time zone not null but no default value. Any ideas on how to do that would be greatly appreciated.