I'm trying to set up a DB for user registration and in want to have a column with the registration date in it, which should be the current time by default. I tried running this query:
CREATE TABLE `users` (
<some stuff>
`uRegDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
)
But it doesn't work with MariaDB. Anyone got a solution?
CURRENT_TIMESTAMP
as a default forDATETIME
type is only available in 10.x. If you're using 5.5, it should aTIMESTAMP
column. – Ha