Hi All,
I added the following models with auto_now_add and auto_now = True.
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
However, after makemigrations and migrate, both fields remains empty when i insert a new row.
I found both created_at and updated_at are not created with auto NOW().
mysql> DESCRIBE API_vehicle;
+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| vehicle_no | varchar(16) | NO | UNI | NULL | |
| created_at | datetime(6) | NO | | NULL | |
| updated_at | datetime(6) | NO | | NULL | |
Is this a bug or I miss some step ? Appreciate help. Thanks.