Open yuraji opened 1 year ago
happens also here with turso ^^
In the meanwhile, I'm manually restoring the data from the temporary column with something like
INSERT OR IGNORE INTO `posts` (`id`, `content`, `created`)
SELECT `id`, `content`, `created`
FROM `__old_push_posts`;
drizzle-kit should be doing something like that.
I am also having this error, and its very annoying :(
Facing this issue with Turso. Added extra column to table and get this error
LibsqlError: SQLITE_UNKNOWN: SQLite error: table listings has 13 columns but 12 values were supplied
at mapHranaError (file:///Users/shrihari/_/node_modules/.pnpm/@libsql+client@0.4.0-pre.2/node_modules/@libsql/client/lib-esm/hrana.js:257:16)
at HttpClient.execute (file:///Users/shrihari/_/node_modules/.pnpm/@libsql+client@0.4.0-pre.2/node_modules/@libsql/client/lib-esm/http.js:53:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TursoSqlite.run (/Users/shrihari/_/node_modules/.pnpm/drizzle-kit@0.20.6/node_modules/drizzle-kit/bin.cjs:25497:9)
at async Command.<anonymous> (/Users/shrihari/_/node_modules/.pnpm/drizzle-kit@0.20.6/node_modules/drizzle-kit/bin.cjs:63284:9) {
code: 'SQLITE_UNKNOWN',
rawCode: undefined,
[cause]: [ResponseError: SQLite error: table listings has 13 columns but 12 values were supplied] {
code: 'SQLITE_UNKNOWN',
proto: {
message: 'SQLite error: table listings has 13 columns but 12 values were supplied',
code: 'SQLITE_UNKNOWN'
}
}
}
(changed the project name to _ in the above)
"drizzle-kit": "^0.20.6",
"drizzle-orm": "^0.29.0",
is there any workaround until this is fixed?
any updates?
don't understand what's happening. I got this same error after adding two columns to my schema and using drizzle-kit push:sqlite
same problem
After reading the docs, I can see that the push command is not intended to be used with production db's. It is only for local development, where you are expected to be able to delete the database and restart anytime you make a change.
is there any update on this?
any update?
This is issue is still occuring. I am using turso
+1
Also happening here.
Any updates for this issue? Specifically using turso in dev mode. Issue also occurs on tables that have a foreign key constraint. It is currently not possible to add a new table using the drizzle kit generate and migrate command.
Woo still this issue, Suddenly everyone is using Turso,
I just copy paste the generate sql into Turso SQL runner
like this
ALTER TABLE setting
ADD enable_warning
integer DEFAULT true;
What version of
drizzle-orm
are you using?0.28.6(better-sqlite3@8.6.0)
What version of
drizzle-kit
are you using?0.19.13
Describe the Bug
After adding a column to a table in schema, and executing
drizzle-kit push:sqlite
, it fails with error:SqliteError: table posts has 4 columns but 3 values were supplied
In the database there's now
__old_push_posts
table, that the originalposts
table was renamed into, with all the data.There's also now a new
posts
table with 4 columns, but no data.The error message suggests that drizzle-kit fails to copy the data over after the change, because of the different number of columns.
Running
push
again, warns that it's going to delete the__old_push_posts
, but I know that it contains the original data, not copied to the newposts
table.Expected behavior
drizzle-kit should be able to add a new column to a table in an sqlite db, with all the data intact, after adding a column to a table schema.
Environment & setup
Apple M1 Pro, Sonoma, Node v19.7.0