Replies: 1 comment 1 reply
-
When you use CURRENT_TIMESTAMP in that context (as a default column value), you need to make sure it is wrapped in parentheses. This should work: set_constant_sql Sequel::CURRENT_TIMESTAMP, "(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')" Alternatively, you could keep the constant SQL, and change the default option: column :created_at, :timestamp, null: false, default: [Sequel::CURRENT_TIMESTAMP] |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Overview
Hello. 👋 I was trying to load the
constant_sql_override
extension and then use it to ensure the current time zone defaults to UTC but keep getting the following error when running migrations:I'm not sure if this is a bug or if I'm using the extension incorrectly (probably the latter).
Steps to Recreate
Here's, roughly, what I'm using for my setup:
I'm basically following the extension's documentation. As for my migrations, I'm writing code like this (which should default to UTC):
Lastly, if it helps, I'm wiring this up using Hanami via the persistence provider. If you need to see the full picture, you'd apply the diff above to this provider code to see how I'm wiring this all together.
If there is any additional information I can provide, let me know. Thanks!
Environment
Beta Was this translation helpful? Give feedback.
All reactions