Mysql
 sql >> Datenbank >  >> RDS >> Mysql

MySQL:Ungültiger Standardwert für TIMESTAMP

Interessanterweise funktionieren beide:

`start_time` timestamp(6), 

Und:

`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

Sie können letzteres verwenden -- lassen Sie den Genauigkeitsbezeichner aus der Definition heraus.

Aber die richtige Methode ist:

`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),

Wie in der Dokumentation erklärt :