Closed ropoko closed 7 months ago
On migrations, when I try to add the default value current_date on a column with type date, I got this error:
current_date
date
ERROR: invalid input syntax for type date: "current_date" (127)
And here is how I tried:
schema.create_table('rules', { ... { 'created_at', types.date({ default='current_date' }) }, })
The error here is that lapis created this SQL:
... "created_at" date NOT NULL DEFAULT 'current_date'
and the current_date should not be in quotes.
You can use default = db.raw("current_date") to insert a SQL fragment directly as the default, otherwise it's treated as a string literal
default = db.raw("current_date")
On migrations, when I try to add the default value
current_date
on a column with typedate
, I got this error:And here is how I tried:
The error here is that lapis created this SQL:
and the
current_date
should not be in quotes.