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

User deletions #367

Open
4 tasks
oscartbeaumont opened this issue Jun 12, 2024 · 1 comment
Open
4 tasks

User deletions #367

oscartbeaumont opened this issue Jun 12, 2024 · 1 comment

Comments

@oscartbeaumont
Copy link
Member

oscartbeaumont commented Jun 12, 2024

Properly handle delete users.

TODO:

  • Sync with EntraID

Delete all relatations including:

  • Device ownership
  • Group assignments
  • Policy/app direct assignments
@oscartbeaumont
Copy link
Member Author

Error: Cannot delete or update a parent row: a foreign key constraint fails (`mattrax`.`devices`, CONSTRAINT `devices_owner_users_pk_fk` FOREIGN KEY (`owner`) REFERENCES `users` (`pk`))
    at PromisePoolConnection.execute (/Users/oscar/Desktop/mattrax/node_modules/.pnpm/[email protected]/node_modules/mysql2/promise.js:112:22)
    at eval (/Users/oscar/Desktop/mattrax/packages/mysql-planetscale/src/index.ts:54:54)
    at fetch (/Users/oscar/Desktop/mattrax/apps/web/src/db/index.ts:26:43)
    at postJSON (file:///Users/oscar/Desktop/mattrax/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:125:28)
    at Connection.execute (file:///Users/oscar/Desktop/mattrax/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:81:29)
    at Tx.execute (file:///Users/oscar/Desktop/mattrax/node_modules/.pnpm/@[email protected]/node_modules/@planetscale/database/dist/index.js:34:26)
    at PlanetScalePreparedQuery.execute (file:///Users/oscar/Desktop/mattrax/node_modules/.pnpm/[email protected]_patch_hash=kbhw3lxqs5ui6og332q7mjjsdu_@[email protected]_p7m3ncyjhy73fkeey37kfdlyfy/node_modules/drizzle-orm/planetscale-serverless/session.js:28:21)
    at QueryPromise.execute (file:///Users/oscar/Desktop/mattrax/node_modules/.pnpm/[email protected]_patch_hash=kbhw3lxqs5ui6og332q7mjjsdu_@[email protected]_p7m3ncyjhy73fkeey37kfdlyfy/node_modules/drizzle-orm/mysql-core/query-builders/delete.js:61:27)
    at QueryPromise.then (file:///Users/oscar/Desktop/mattrax/node_modules/.pnpm/[email protected]_patch_hash=kbhw3lxqs5ui6og332q7mjjsdu_@[email protected]_p7m3ncyjhy73fkeey37kfdlyfy/node_modules/drizzle-orm/query-promise.js:21:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ER_ROW_IS_REFERENCED_2',
  errno: 1451,
  sql: 'delete from `users` where `users`.`provider` = 5',
  sqlState: '23000',
  sqlMessage: 'Cannot delete or update a parent row: a foreign key constraint fails (`mattrax`.`devices`, CONSTRAINT `devices_owner_users_pk_fk` FOREIGN KEY (`owner`) REFERENCES `users` (`pk`))'
}

because of this not being implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant