How can I set default current timestmp in mySQL?
I want to have current timestamp in that field when the record is modilfied
I used below code but got error as below
AddDefaultValue(
model_name='my_model',
name='my_column',
value='NOW'
),
File "C:\Python310\lib\site-packages\MySQLdb\connections.py", line 254, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1067, "Invalid default value for 'my_column'")
Dear Sir,
How can I set default current timestmp in mySQL? I want to have current timestamp in that field when the record is modilfied
I used below code but got error as below AddDefaultValue( model_name='my_model', name='my_column', value='NOW' ),
File "C:\Python310\lib\site-packages\MySQLdb\connections.py", line 254, in query _mysql.connection.query(self, query) django.db.utils.OperationalError: (1067, "Invalid default value for 'my_column'")
Regards, Oil