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

Trouble Pushing Cart Table Schema (Lesson 12) #15

Open
soundsystems opened this issue Sep 14, 2024 · 0 comments
Open

Trouble Pushing Cart Table Schema (Lesson 12) #15

soundsystems opened this issue Sep 14, 2024 · 0 comments

Comments

@soundsystems
Copy link

soundsystems commented Sep 14, 2024

When implementing the add to cart feature (about halfway through part 12), I am getting the following error when trying to push to my db:

--> npx drizzle-kit push
No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/jaay/Documents/dev/shop-dadli/drizzle.config.ts'
Using 'pg' driver for database querying
[✓] Pulling schema from database...

ERROR: column "userId" cannot be cast automatically to type uuid
at /Users/jaay/Documents/dev/shop-dadli/node_modules/.pnpm/[email protected][email protected]/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.query (/Users/jaay/Documents/dev/shop-dadli/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:71880:26)
at async pgPush (/Users/jaay/Documents/dev/shop-dadli/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:74835:13)
at async Object.handler (/Users/jaay/Documents/dev/shop-dadli/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:83713:9)
at async run (/Users/jaay/Documents/dev/shop-dadli/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:82064:7) {
length: 179,
severity: 'ERROR',
code: '42804',
detail: undefined,
hint: 'You might need to specify "USING "userId"::uuid".',
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'tablecmds.c',
line: '12391',
routine: 'ATPrepAlterColumnType'
}


Did I miss something or create the table incorrectly?
You can see my code on my page under shop-dadli. Any help would be greatly appreciated, Bassir. Thank you for this tutorial. It has been very helpful to me.

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