GandalfTheMopy
GandalfTheMopy
DTDrizzle Team
Created by GandalfTheMopy on 6/1/2024 in #help
Turso Schema Database migration with drizzle-orm/libsql/migrator
hi all, having this issue with migrations using drizzle for turso schema databases (--type schema), is this somehow affected by turso running these migrations as transactions internally, and drizzle trying to run the migrations in transactions too, causing "the migration is already run within a transaction" error? 6 | rawCode; 7 | constructor(message, code, rawCode, cause) { 8 | if (code !== undefined) { 9 | message = ${code}: ${message}; 10 | } 11 | super(message, { cause }); ^ LibsqlError: SCHEMA_MIGRATION_ERROR: Schema migration error: migration is invalid: it contains transaction items (BEGIN, COMMIT, SAVEPOINT...) which are not allowed. The migration is already run within a transaction code: "SCHEMA_MIGRATION_ERROR" at new LibsqlError (/node_modules/@libsql/core/lib-esm/api.js:11:9) at mapHranaError (/node_modules/@libsql/client/lib-esm/hrana.js:257:16) at /node_modules/@libsql/client/lib-esm/http.js:85:19 1 | / Generic error produced by the Hrana client. */ 2 | export class ClientError extends Error { 3 | / @private */ 4 | constructor(message) { ^ ResponseError: Schema migration error: migration is invalid: it contains transaction items (BEGIN, COMMIT, SAVEPOINT...) which are not allowed. The migration is already run within a transaction code: "SCHEMA_MIGRATION_ERROR" at /node_modules/@libsql/hrana-client/lib-esm/errors.js:4:11
1 replies