You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a working setup for drizzle, occasionally changing the schema and migrating it successfully. I made a small change today and I am facing an error I do not understand.
This is the schema I want to push:
exportconstactionsLog=sqliteTable('actionLog',{id: text().primaryKey().$default(()=>nanoid()),who: text().notNull().references(()=>users.id),// FK to userstimestamp: integer({mode: 'timestamp'}).$default(()=>newDate()),what: text({enum: ['create','update','delete','login','logout'],}).notNull(),data: text({mode: 'json'}),})
The modification was the addition of the table timestamp.
> npx drizzle-kit push
No config path provided, using default 'drizzle.config.ts'
Reading config file 'C:\Users\yop\dev\perso\never-alone\drizzle.config.ts'
[✓] Pulling schema from database...
Is timestamp column in actionLog table created or renamed from another column?
❯ + timestamp create column
~ when › timestamp rename column
After choosing "create column" (the first choice), I get:
+ timestamp column will be created
--- all columns conflicts in actionLog table resolved ---
LibsqlError: SQLITE_ERROR: no such column: timestamp
at mapSqliteError (file:///C:/Users/yop/dev/perso/never-alone/node_modules/@libsql/client/lib-esm/sqlite3.js:380:16)
at executeStmt (file:///C:/Users/yop/dev/perso/never-alone/node_modules/@libsql/client/lib-esm/sqlite3.js:285:15)
at Sqlite3Client.execute (file:///C:/Users/yop/dev/perso/never-alone/node_modules/@libsql/client/lib-esm/sqlite3.js:81:16)
... 4 lines matching cause stack trace ...
at async run (C:\Users\yop\dev\perso\never-alone\node_modules\drizzle-kit\bin.cjs:91395:7) {
code: 'SQLITE_ERROR',
rawCode: 1,
[cause]: SqliteError: no such column: timestamp
at convertError (C:\Users\yop\dev\perso\never-alone\node_modules\libsql\index.js:53:12)
at Database.prepare (C:\Users\yop\dev\perso\never-alone\node_modules\libsql\index.js:123:13)
at executeStmt (file:///C:/Users/yop/dev/perso/never-alone/node_modules/@libsql/client/lib-esm/sqlite3.js:256:28)
at Sqlite3Client.execute (file:///C:/Users/yop/dev/perso/never-alone/node_modules/@libsql/client/lib-esm/sqlite3.js:81:16)
at Object.run (C:\Users\yop\dev\perso\never-alone\node_modules\drizzle-kit\bin.cjs:78810:26)
at sqlitePush (C:\Users\yop\dev\perso\never-alone\node_modules\drizzle-kit\bin.cjs:82017:26)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Object.handler (C:\Users\yop\dev\perso\never-alone\node_modules\drizzle-kit\bin.cjs:92168:9)
at async run (C:\Users\yop\dev\perso\never-alone\node_modules\drizzle-kit\bin.cjs:91395:7) {
code: 'SQLITE_ERROR',
rawCode: 1
}
}
I tried to create a new table (by changing the name in the code above) but same error.
What does that mean? What does the "no such column" applies to?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I had a working setup for drizzle, occasionally changing the schema and migrating it successfully. I made a small change today and I am facing an error I do not understand.
This is the schema I want to push:
The modification was the addition of the table
timestamp
.After choosing "create column" (the first choice), I get:
I tried to create a new table (by changing the name in the code above) but same error.
What does that mean? What does the "no such column" applies to?
Beta Was this translation helpful? Give feedback.
All reactions