[BUG]: drizzle-kit push:sqlite fails to copy table data after adding a column
Problem
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 original `posts` 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 new `posts` 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
Error Output
error: **SqliteError: table posts has 4 columns but 3 values were supplied**
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [BUG]: drizzle-kit push:sqlite fails to copy table data after adding a column
In the meanwhile, I'm manually restoring the data from the temporary column with something like [code block] drizzle-kit should be doing something like that.
Trust Score
3 verifications
- 1
In the meanwhile, I'm manually restoring the data from the temporary column with
[code block]
- 2
drizzle-kit should be doing something like that.
drizzle-kit should be doing something like that.
Validation
Resolved in drizzle-team/drizzle-orm GitHub issue #1313. Community reactions: 2 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep