Error migrating after updating to orm 0.23.3

After updating to the package released an hour ago, I am getting an error on migrating: error - RangeError: The supplied SQL string contains more than one statement at Database.prepare (.../node_modules/better-sqlite3/lib/methods/wrappers.js:5:21) at BetterSQLiteSession.prepareQuery (.../node_modules/drizzle-orm/better-sqlite3/session.js:19:34) at BetterSQLiteSession.prepareOneTimeQuery (.../node_modules/drizzle-orm/sqlite-core/session.js:14:21) at BetterSQLiteSession.run (.../node_modules/drizzle-orm/sqlite-core/session.js:17:21) at SQLiteSyncDialect.migrate (.../node_modules/drizzle-orm/sqlite-core/dialect.js:255:33) at migrate (.../node_modules/drizzle-orm/better-sqlite3/migrator.js:7:16) Migration code:
import { drizzle } from "drizzle-orm/better-sqlite3";
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
import Database from "better-sqlite3";

const sqlite = new Database("sqlite.db");
const db = drizzle(sqlite, { logger: true });
migrate(db, { migrationsFolder: "./db/migrations" });
import { drizzle } from "drizzle-orm/better-sqlite3";
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
import Database from "better-sqlite3";

const sqlite = new Database("sqlite.db");
const db = drizzle(sqlite, { logger: true });
migrate(db, { migrationsFolder: "./db/migrations" });
3 Replies
bloberenober
bloberenober15mo ago
try setting breakpoints: true in your Drizzle config and re-generate the migration
tacomanator
tacomanator15mo ago
Thank you that solves the problem. Should I expect to use that indefinitely going forward?
alexblokh
alexblokh15mo ago
yes, SQLite and MySQL drivers do not support multiple DDL statements in one transaction, so we have to split them and run one by one