Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTERNAL_SERVER_ERROR when try to use $NOW(<adjustment>) $NOW(-1 year), $NOW(+2 hours) #7280

Closed
3 tasks done
hermesalvesbr opened this issue Aug 9, 2021 · 3 comments
Closed
3 tasks done

Comments

@hermesalvesbr
Copy link

Preflight Checklist

Describe the Bug

[INTERNAL_SERVER_ERROR] alter table "individuo" alter column "nascimento" set default '$NOW(-1 year)' - invalid input syntax for type date: "$NOW(-1 year)"
content_copy

To Reproduce

I'm trying to use $NOW(-1 year) like docs: https://docs.directus.io/reference/filter-rules/#dynamic-variables

Just works without

[INTERNAL_SERVER_ERROR] alter table "individuo" add column "nascimentotime" timestamptz null default '$NOW(-1 year)' - invalid input syntax for type timestamp with time zone: "$NOW(-1 year)"
content_copy

I have tried with timestamp, date and datetime.

What version of Directus are you using?

v9.0.0-rc.88

What version of Node.js are you using?

node --version v16.5.0

What database are you using?

Postgres 13

What browser are you using?

Chrome

What operating system are you using?

macOS, Windows

How are you deploying Directus?

Docker

@rijkvanzanten
Copy link
Member

@hermesalvesbr Where are you using this? It's trying to set it as the default value 🤔

@hermesalvesbr
Copy link
Author

Yes, i did some wrong?

Screenshot_20210809-161017_Chrome.png

@rijkvanzanten
Copy link
Member

Ah yeah, those dynamic variables are used in the filter rules, f.e. in filters, permissions, validation, etc. The default value under schema is the default value used for the database column.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants