I searched the web but did not find anything specific to field time in mysql, just date and timestamp, I am creating a field "time_emission" of type "time", because I want to store only the time in this field, the line would be as follows:
ADD COLUMN 'hora_emissao' time NOT NULL DEFAULT CURRENT_TIME;
But I get the following message:
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_TIME
If we give the command: SELECT CURRENT_TIME we see that it shows the time of the server, ie current_time exists.
What is the correct way to create a time field with a default value in mysql?
Note: I can use trigger or other type of field, but the idea is to simplify using the default function and use a same time field, since I only need the time, if there was a default the server time would be great .