Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can I set default current timestmp in mySQL #39

Open
SuphattraT opened this issue Feb 26, 2023 · 0 comments
Open

how can I set default current timestmp in mySQL #39

SuphattraT opened this issue Feb 26, 2023 · 0 comments

Comments

@SuphattraT
Copy link

SuphattraT commented Feb 26, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant