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
CLI Schema import causes crash. #12042
Comments
@stefan1968 Did the instance where you created the snapshot use the same database? (Postgres 13) |
Yes, exactly the same. The only difference, the schema was exported from a directus version 9.5.1 instance and attempted to import from a 9.6.0, the postgres versions are identical however. I can supply the schema if it helps? |
A schema will be helpful indeed! Just so we can be on the same page when reproducing it 👍 With that said, I also just noticed and suspect that the quotation marks around Testing with SQL queriesWith quotesNo quotes |
It's created via the APP/UI, when setting the default value. I use the expression now() when creating the field. Which then turns into CURRENT_TIMESTAMP Here is a link to the schema. https://drive.google.com/drive/folders/1qw_iPfCBhfm9JVvfUxYgmUtxf0TFo8xJ?usp=sharing |
Thanks for the snapshot and clarification. I've just tried it locally and I can reproduce the same issue: This is because of the default value However, I did try to trace and see what's going wrong here and I've found this particular code where we are ensuring directus/api/src/services/fields.ts Lines 541 to 544 in 2419c2b
Using this knowledge, I was able to make your schema snapshot work by swapping So perhaps you can use this workaround for now while we find a better fix for it 👍 |
Preflight Checklist
Describe the Bug
I'm attempting to apply a schema to another clean instance of Directus, but it's throwing an error and crashing.
Screenshot attached.
To Reproduce
Export a schema with a date/timestamp?
Errors Shown
What version of Directus are you using?
9.6.0
What version of Node.js are you using?
16.4.0
What database are you using?
Postgres 13
What browser are you using?
Chrome
What operating system are you using?
Docker
How are you deploying Directus?
Docker
The text was updated successfully, but these errors were encountered: