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

Error apply snapshot - 'COLUMN_TYPE' of undefined #10398

Closed
3 tasks done
geryla opened this issue Dec 8, 2021 · 3 comments
Closed
3 tasks done

Error apply snapshot - 'COLUMN_TYPE' of undefined #10398

geryla opened this issue Dec 8, 2021 · 3 comments

Comments

@geryla
Copy link

geryla commented Dec 8, 2021

Preflight Checklist

Describe the Bug

After several changes in my database schema on localhost, I tried to generate snapshot and deploy it on my server, where run my live application with production database.

After deploy and install same version of Directus, I got issue with apply snapshot..

My snapshot is here: https://codeshare.io/DZvE0Z

To Reproduce

  1. Make changes in local DB.
  2. Generate snapshot by npx directus schema apply ./snapshot.yaml
  3. Deploy snapshot on server
  4. Run npx directus schema snapshot ./snapshot.yaml
  5. Got error

Errors Shown

Cannot read property 'COLUMN_TYPE' of undefined 
TypeError: Cannot read property 'COLUMN_TYPE' of undefined
    at rawColumnToColumn (/var/www/vhosts/skoleni365.cz/cms.skoleni365.cz/node_modules/knex-schema-inspector/dist/dialects/mysql.js:53:30)
    at MySQL.<anonymous> (/var/www/vhosts/skoleni365.cz/cms.skoleni365.cz/node_modules/knex-schema-inspector/dist/dialects/mysql.js:241:47)
    at step (/var/www/vhosts/skoleni365.cz/cms.skoleni365.cz/node_modules/knex-schema-inspector/dist/dialects/mysql.js:44:23)
    at Object.next (/var/www/vhosts/skoleni365.cz/cms.skoleni365.cz/node_modules/knex-schema-inspector/dist/dialects/mysql.js:25:53)
    at fulfilled (/var/www/vhosts/skoleni365.cz/cms.skoleni365.cz/node_modules/knex-schema-inspector/dist/dialects/mysql.js:16:58)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Snímek obrazovky 2021-12-08 v 17 34 36

What version of Directus are you using?

9.2.1

What version of Node.js are you using?

14.18.2

What database are you using?

MariaDB 13.3.28

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying Directus?

Plesk

@rijkvanzanten
Copy link
Member

Reuploaded schema file here for archival reasons:
Dec 08 9_18 AM.txt

@jamescammarano
Copy link
Contributor

jamescammarano commented Jan 26, 2022

In 9.5/MariaDB with that snapshot I'm getting:

23:16:19 🚨 Failed to create collection "contacts"
23:16:19 🚨 Invalid foreign key in field "group".

which I also saw here

and it has an issue #9723

@rijkvanzanten
Copy link
Member

I'm not able to reproduce this unfortunately..

@geryla Would you be able to share a database dump of the database where this problem is happening?

I'll close this for now, but happy to keep discussing/debugging 👍🏻

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 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

3 participants