LeFuncq
LeFuncq
DTDrizzle Team
Created by LeFuncq on 11/29/2023 in #help
TypeError: Cannot read properties of undefined (reading 'type') on drizzle kit push command
Can't run drizzle push:mysql on planetscale database, I'm getting this weird error:
+ Auditors table will be created
+ Integrators table will be created
+ IntegratorSelections table will be created
+ IntegratorTag table will be created
+ UserEmailVerifications table will be created
+ Users table will be created
--- all table conflicts resolved ---

/Users/*/Work/Trustblock/Dev/monorepo/node_modules/drizzle-kit/bin.cjs:60388
if (unsquashed.columns.length === 1 && currentSchema.tables[statement.tableName].columns[unsquashed.columns[0]].type === "serial" && prevSchema.tables[statement.tableName].columns[unsquashed.columns[0]].type === "serial" && currentSchema.tables[statement.tableName].columns[unsquashed.columns[0]].name === unsquashed.columns[0]) {
^

TypeError: Cannot read properties of undefined (reading 'type')
at /Users/*/Work/Trustblock/Dev/monorepo/node_modules/drizzle-kit/bin.cjs:60388:119
at Array.filter (<anonymous>)
at filterStatements (/Users/*/Work/Trustblock/Dev/monorepo/node_modules/drizzle-kit/bin.cjs:60368:21)
at Command.<anonymous> (/Users/*/Work/Trustblock/Dev/monorepo/node_modules/drizzle-kit/bin.cjs:60979:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
+ Auditors table will be created
+ Integrators table will be created
+ IntegratorSelections table will be created
+ IntegratorTag table will be created
+ UserEmailVerifications table will be created
+ Users table will be created
--- all table conflicts resolved ---

/Users/*/Work/Trustblock/Dev/monorepo/node_modules/drizzle-kit/bin.cjs:60388
if (unsquashed.columns.length === 1 && currentSchema.tables[statement.tableName].columns[unsquashed.columns[0]].type === "serial" && prevSchema.tables[statement.tableName].columns[unsquashed.columns[0]].type === "serial" && currentSchema.tables[statement.tableName].columns[unsquashed.columns[0]].name === unsquashed.columns[0]) {
^

TypeError: Cannot read properties of undefined (reading 'type')
at /Users/*/Work/Trustblock/Dev/monorepo/node_modules/drizzle-kit/bin.cjs:60388:119
at Array.filter (<anonymous>)
at filterStatements (/Users/*/Work/Trustblock/Dev/monorepo/node_modules/drizzle-kit/bin.cjs:60368:21)
at Command.<anonymous> (/Users/*/Work/Trustblock/Dev/monorepo/node_modules/drizzle-kit/bin.cjs:60979:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The error is caused by this part: currentSchema.tables[statement.tableName].columns[unsquashed.columns[0]].type
6 replies
DTDrizzle Team
Created by LeFuncq on 11/28/2023 in #help
Bypass migrations when updating Planetscale schema on dev branches
Hi there, Sorry, I'm a beginner in MySQL and databases, but I was wondering if there was a way to push a new schema to Planetscale using drizzle-kit without dealing with migrations. When developing a new feature, many changes might be made to the schema. As such, being able to directly override the schema on my Planetscale's dev branch would be useful! Any idea how to do that?
1 replies
DTDrizzle Team
Created by LeFuncq on 11/22/2023 in #help
Create unique slugs with $defaultFn
Hi there, Just wanted to know if it was possible to create unique slugs for every user using $defaultFn. My slugs are generated based on another field's value and must be unique. Using defaultFn, can I access the tables current values?
7 replies