drizzle-kit 1.0.0-beta.21 → 1.0.0-beta.22-1b8fcb2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api-mysql.js CHANGED
@@ -6,7 +6,7 @@ const startStudioServer = async (imports, credentials, options) => {
6
6
  const { is } = require("drizzle-orm");
7
7
  const { MySqlTable, getTableConfig } = require("drizzle-orm/mysql-core");
8
8
  const { Relations } = require("drizzle-orm/_relations");
9
- const { drizzleForMySQL, prepareServer } = await Promise.resolve().then(() => require("./studio-BRMcKTKQ.js"));
9
+ const { drizzleForMySQL, prepareServer } = await Promise.resolve().then(() => require("./studio-6WVuyNxo.js"));
10
10
  const mysqlSchema = {};
11
11
  const relations = {};
12
12
  Object.entries(imports).forEach(([k, t]) => {
package/api-mysql.mjs CHANGED
@@ -213394,7 +213394,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
213394
213394
  const { driver } = credentials;
213395
213395
  if (driver === "d1-http") {
213396
213396
  const { drizzle } = await import("drizzle-orm/sqlite-proxy");
213397
- const { migrate } = await import("drizzle-orm/sqlite-proxy/migrator");
213397
+ const { migrateInternal } = await import("drizzle-orm/sqlite-proxy/migrator.internal");
213398
213398
  const remoteCallback = async (sql, params, method) => {
213399
213399
  const data = await (await fetch$1(`https://api.cloudflare.com/client/v4/accounts/${credentials.accountId}/d1/database/${credentials.databaseId}/${method === "values" ? "raw" : "query"}`, {
213400
213400
  method: "POST",
@@ -213431,9 +213431,9 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
213431
213431
  };
213432
213432
  const drzl = drizzle(remoteCallback);
213433
213433
  const migrateFn = async (config) => {
213434
- return migrate(drzl, async (queries) => {
213434
+ return migrateInternal(drzl, async (queries) => {
213435
213435
  for (const query of queries) await remoteCallback(query, [], "run");
213436
- }, config);
213436
+ }, config, "run");
213437
213437
  };
213438
213438
  const query = async (sql, params) => {
213439
213439
  return (await remoteCallback(sql, params || [], "all")).rows;
package/api-postgres.js CHANGED
@@ -372,7 +372,7 @@ const generateDrizzleJson = async (imports, prevId, schemaFilters, casing) => {
372
372
  };
373
373
  const generateMigration = async (prev, cur) => {
374
374
  const { resolver } = await Promise.resolve().then(() => require("./prompts-DfsG1lFx.js")).then((n) => n.prompts_exports);
375
- const { ddlDiff } = await Promise.resolve().then(() => require("./diff-BQc-7Nm8.js")).then((n) => n.diff_exports);
375
+ const { ddlDiff } = await Promise.resolve().then(() => require("./diff-BHBkEJHk.js")).then((n) => n.diff_exports);
376
376
  const from = require_ddl.createDDL();
377
377
  const to = require_ddl.createDDL();
378
378
  for (const it of prev.ddl) from.entities.push(it);
@@ -385,9 +385,9 @@ const pushSchema = async (imports, drizzleInstance, casing, entitiesConfig, migr
385
385
  const { resolver } = await Promise.resolve().then(() => require("./prompts-DfsG1lFx.js")).then((n) => n.prompts_exports);
386
386
  const { fromDatabaseForDrizzle } = await Promise.resolve().then(() => require("./introspect-Dl3YI0in.js"));
387
387
  const { fromDrizzleSchema, fromExports } = await Promise.resolve().then(() => require("./drizzle-DX4zjwm_.js")).then((n) => n.drizzle_exports);
388
- const { suggestions } = await Promise.resolve().then(() => require("./push-postgres-DzAXAQgJ.js"));
388
+ const { suggestions } = await Promise.resolve().then(() => require("./push-postgres-BJDZb4tT.js"));
389
389
  const { extractPostgresExisting } = await Promise.resolve().then(() => require("./drizzle-Bj7v9CEh.js")).then((n) => n.drizzle_exports);
390
- const { ddlDiff } = await Promise.resolve().then(() => require("./diff-BQc-7Nm8.js")).then((n) => n.diff_exports);
390
+ const { ddlDiff } = await Promise.resolve().then(() => require("./diff-BHBkEJHk.js")).then((n) => n.diff_exports);
391
391
  const { sql } = require("drizzle-orm");
392
392
  const migrations = {
393
393
  schema: migrationsConfig?.schema || "drizzle",
@@ -423,7 +423,7 @@ const startStudioServer = async (imports, credentials, options) => {
423
423
  const { is } = require("drizzle-orm");
424
424
  const { PgTable, getTableConfig } = require("drizzle-orm/pg-core");
425
425
  const { Relations } = require("drizzle-orm/_relations");
426
- const { drizzleForPostgres, prepareServer } = await Promise.resolve().then(() => require("./studio-BRMcKTKQ.js"));
426
+ const { drizzleForPostgres, prepareServer } = await Promise.resolve().then(() => require("./studio-6WVuyNxo.js"));
427
427
  const pgSchema = {};
428
428
  const relations = {};
429
429
  Object.entries(imports).forEach(([k, t]) => {
package/api-postgres.mjs CHANGED
@@ -10,7 +10,7 @@ import fs, { existsSync, lstatSync, mkdirSync, readdirSync, writeFileSync } from
10
10
  import m from "node:path";
11
11
  import re, { promises } from "node:fs";
12
12
  import Be from "os";
13
- import Ie, { dirname, join, resolve } from "path";
13
+ import path, { dirname, join, resolve } from "path";
14
14
  import { parse, pathToFileURL } from "url";
15
15
  import { fileURLToPath, format } from "node:url";
16
16
  import { deprecate, promisify, types } from "node:util";
@@ -1825,7 +1825,7 @@ function Et(e) {
1825
1825
  throw new RangeError(`invalid RFC 9557 time-only string ${e}; may need a T prefix`);
1826
1826
  }
1827
1827
  function It(e) {
1828
- const t = Ie$1.exec(e);
1828
+ const t = Ie.exec(e);
1829
1829
  let n, r, o, i;
1830
1830
  if (t) {
1831
1831
  o = Tt(t[3]);
@@ -4252,7 +4252,7 @@ function zi(e, t) {
4252
4252
  function Ai(e, t) {
4253
4253
  return vt(e, wt), Hi(e).time[t];
4254
4254
  }
4255
- var import_jsbi_cjs, t$4, n$3, r$4, o$3, i$5, a$4, s$5, c$3, d$4, h$6, u$4, l$3, w$4, v$4, b$3, D$1, T$1, M, E$3, I$3, C$2, O$2, $, Y$1, R$1, S$1, j$3, k$3, N$1, x$4, L, P$2, U, B$1, Z$2, F$2, H$2, z$1, A$3, q$4, W, _$1, J$2, G$2, K$1, V, X$1, Q$1, ee$1, te$1, ie$1, TimeDuration, me$1, fe$1, ye$1, pe$1, ge$1, we$1, ve$1, be$1, De$1, Te$1, Me$1, Ee, Ie$1, Ce$1, Oe$1, $e$1, Ye$1, Re$1, Se$1, je$1, ke$1, Ne$1, xe, Le$1, Pe$1, Ue$1, Be$1, Ze$1, Fe$1, He$1, ze$1, Qe$1, et, tt, nt, rt, ot, it, at, st, ct, dt, Ot, $t, qt, cr, dr, Po, Wo, _o, Xo, OneObjectCache, HelperBase, HebrewHelper, IslamicBaseHelper, IslamicHelper, IslamicUmalquraHelper, IslamicTblaHelper, IslamicCivilHelper, IslamicRgsaHelper, IslamicCcHelper, PersianHelper, IndianHelper, GregorianBaseHelperFixedEpoch, GregorianBaseHelper, SameMonthDayAsGregorianBaseHelper, ii, OrthodoxBaseHelperFixedEpoch, OrthodoxBaseHelper, EthioaaHelper, CopticHelper, EthiopicHelper, RocHelper, BuddhistHelper, GregoryHelper, JapaneseHelper, ChineseBaseHelper, ChineseHelper, DangiHelper, NonIsoCalendar, ai, DateTimeFormatImpl, di, Ri, Si, Instant, PlainDate, PlainDateTime, Duration, PlainMonthDay, Bi, PlainTime, PlainYearMonth, Fi, ZonedDateTime, qi, _i;
4255
+ var import_jsbi_cjs, t$4, n$3, r$4, o$3, i$5, a$4, s$5, c$3, d$4, h$6, u$4, l$3, w$4, v$4, b$3, D$1, T$1, M, E$3, I$3, C$2, O$2, $, Y$1, R$1, S$1, j$3, k$3, N$1, x$4, L, P$2, U, B$1, Z$2, F$2, H$2, z$1, A$3, q$4, W, _$1, J$2, G$2, K$1, V, X$1, Q$1, ee$1, te$1, ie$1, TimeDuration, me$1, fe$1, ye$1, pe$1, ge$1, we$1, ve$1, be$1, De$1, Te$1, Me$1, Ee, Ie, Ce$1, Oe$1, $e$1, Ye$1, Re$1, Se$1, je$1, ke$1, Ne$1, xe, Le$1, Pe$1, Ue$1, Be$1, Ze$1, Fe$1, He$1, ze$1, Qe$1, et, tt, nt, rt, ot, it, at, st, ct, dt, Ot, $t, qt, cr, dr, Po, Wo, _o, Xo, OneObjectCache, HelperBase, HebrewHelper, IslamicBaseHelper, IslamicHelper, IslamicUmalquraHelper, IslamicTblaHelper, IslamicCivilHelper, IslamicRgsaHelper, IslamicCcHelper, PersianHelper, IndianHelper, GregorianBaseHelperFixedEpoch, GregorianBaseHelper, SameMonthDayAsGregorianBaseHelper, ii, OrthodoxBaseHelperFixedEpoch, OrthodoxBaseHelper, EthioaaHelper, CopticHelper, EthiopicHelper, RocHelper, BuddhistHelper, GregoryHelper, JapaneseHelper, ChineseBaseHelper, ChineseHelper, DangiHelper, NonIsoCalendar, ai, DateTimeFormatImpl, di, Ri, Si, Instant, PlainDate, PlainDateTime, Duration, PlainMonthDay, Bi, PlainTime, PlainYearMonth, Fi, ZonedDateTime, qi, _i;
4256
4256
  var init_index_esm = __esmMin((() => {
4257
4257
  import_jsbi_cjs = /* @__PURE__ */ __toESM(require_jsbi_cjs(), 1);
4258
4258
  t$4 = import_jsbi_cjs.default.BigInt(0), n$3 = import_jsbi_cjs.default.BigInt(1), r$4 = import_jsbi_cjs.default.BigInt(2), o$3 = import_jsbi_cjs.default.BigInt(10), i$5 = import_jsbi_cjs.default.BigInt(24), a$4 = import_jsbi_cjs.default.BigInt(60), s$5 = import_jsbi_cjs.default.BigInt(1e3), c$3 = import_jsbi_cjs.default.BigInt(1e6), d$4 = import_jsbi_cjs.default.BigInt(1e9), h$6 = import_jsbi_cjs.default.multiply(import_jsbi_cjs.default.BigInt(3600), d$4), u$4 = import_jsbi_cjs.default.multiply(a$4, d$4), l$3 = import_jsbi_cjs.default.multiply(h$6, i$5);
@@ -4339,7 +4339,7 @@ var init_index_esm = __esmMin((() => {
4339
4339
  `(?:${De$1.source})?`,
4340
4340
  `(?:\\[!?${fe$1.source}\\])?`,
4341
4341
  `((?:${Te$1.source})*)$`
4342
- ].join("")), Ie$1 = new RegExp(`^(${ye$1.source})-?(${pe$1.source})(?:\\[!?${fe$1.source}\\])?((?:${Te$1.source})*)$`), Ce$1 = new RegExp(`^(?:--)?(${pe$1.source})-?(${ge$1.source})(?:\\[!?${fe$1.source}\\])?((?:${Te$1.source})*)$`), Oe$1 = /(\d+)(?:[.,](\d{1,9}))?/, $e$1 = new RegExp(`(?:${Oe$1.source}H)?(?:${Oe$1.source}M)?(?:${Oe$1.source}S)?`), Ye$1 = new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${$e$1.source})?$`, "i"), Re$1 = 864e5, Se$1 = 1e6 * Re$1, je$1 = 6e10, ke$1 = 1e8 * Re$1, Ne$1 = xo(ke$1), xe = import_jsbi_cjs.default.unaryMinus(Ne$1), Le$1 = import_jsbi_cjs.default.add(import_jsbi_cjs.default.subtract(xe, l$3), n$3), Pe$1 = import_jsbi_cjs.default.subtract(import_jsbi_cjs.default.add(Ne$1, l$3), n$3), Ue$1 = 146097 * Re$1, Be$1 = -271821, Ze$1 = 275760, Fe$1 = Date.UTC(1847, 0, 1), He$1 = [
4342
+ ].join("")), Ie = new RegExp(`^(${ye$1.source})-?(${pe$1.source})(?:\\[!?${fe$1.source}\\])?((?:${Te$1.source})*)$`), Ce$1 = new RegExp(`^(?:--)?(${pe$1.source})-?(${ge$1.source})(?:\\[!?${fe$1.source}\\])?((?:${Te$1.source})*)$`), Oe$1 = /(\d+)(?:[.,](\d{1,9}))?/, $e$1 = new RegExp(`(?:${Oe$1.source}H)?(?:${Oe$1.source}M)?(?:${Oe$1.source}S)?`), Ye$1 = new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${$e$1.source})?$`, "i"), Re$1 = 864e5, Se$1 = 1e6 * Re$1, je$1 = 6e10, ke$1 = 1e8 * Re$1, Ne$1 = xo(ke$1), xe = import_jsbi_cjs.default.unaryMinus(Ne$1), Le$1 = import_jsbi_cjs.default.add(import_jsbi_cjs.default.subtract(xe, l$3), n$3), Pe$1 = import_jsbi_cjs.default.subtract(import_jsbi_cjs.default.add(Ne$1, l$3), n$3), Ue$1 = 146097 * Re$1, Be$1 = -271821, Ze$1 = 275760, Fe$1 = Date.UTC(1847, 0, 1), He$1 = [
4343
4343
  "iso8601",
4344
4344
  "hebrew",
4345
4345
  "islamic",
@@ -17023,7 +17023,7 @@ var init_unescape = __esmMin((() => {
17023
17023
  }));
17024
17024
  //#endregion
17025
17025
  //#region ../node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/index.js
17026
- var import_brace_expansion, minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform, path$6, sep, GLOBSTAR, plTypes, qmark, star, twoStarDot, twoStarNoDot, charSet, reSpecials, addPatternStartSet, filter, ext, defaults$2, braceExpand, MAX_PATTERN_LENGTH, assertValidPattern, makeRe, match$1, globUnescape, globMagic, regExpEscape, Minimatch;
17026
+ var import_brace_expansion, minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform, path$7, sep, GLOBSTAR, plTypes, qmark, star, twoStarDot, twoStarNoDot, charSet, reSpecials, addPatternStartSet, filter, ext, defaults$2, braceExpand, MAX_PATTERN_LENGTH, assertValidPattern, makeRe, match$1, globUnescape, globMagic, regExpEscape, Minimatch;
17027
17027
  var init_mjs = __esmMin((() => {
17028
17028
  import_brace_expansion = /* @__PURE__ */ __toESM(require_brace_expansion(), 1);
17029
17029
  init_brace_expressions();
@@ -17083,11 +17083,11 @@ var init_mjs = __esmMin((() => {
17083
17083
  return (f) => f.length === len && f !== "." && f !== "..";
17084
17084
  };
17085
17085
  defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
17086
- path$6 = {
17086
+ path$7 = {
17087
17087
  win32: { sep: "\\" },
17088
17088
  posix: { sep: "/" }
17089
17089
  };
17090
- sep = defaultPlatform === "win32" ? path$6.win32.sep : path$6.posix.sep;
17090
+ sep = defaultPlatform === "win32" ? path$7.win32.sep : path$7.posix.sep;
17091
17091
  minimatch.sep = sep;
17092
17092
  GLOBSTAR = Symbol("globstar **");
17093
17093
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -24054,8 +24054,15 @@ const users = mysqlTable('users', {
24054
24054
  }, 128);
24055
24055
  this.on("detach", () => clearInterval(this.timeout));
24056
24056
  }
24057
- render(status) {
24058
- if (status === "pending" || status === "rejected") return `[${this.spinner.value()}] applying migrations...`;
24057
+ render(status, error) {
24058
+ if (status === "rejected") {
24059
+ if (error?.cause) {
24060
+ console.log("\n");
24061
+ console.log(error.cause);
24062
+ }
24063
+ return `[${chalk.red("✗")}] Error during migration:\n${chalk.red(error ? error.message : "unknown error occured")}\n`;
24064
+ }
24065
+ if (status === "pending") return `[${this.spinner.value()}] applying migrations...`;
24059
24066
  return `[${chalk.green("✓")}] migrations applied successfully!`;
24060
24067
  }
24061
24068
  };
@@ -24077,8 +24084,15 @@ const users = mysqlTable('users', {
24077
24084
  }, 128);
24078
24085
  this.on("detach", () => clearInterval(this.timeout));
24079
24086
  }
24080
- render(status) {
24081
- if (status === "pending" || status === "rejected") return `[${this.spinner.value()}] ${this.progressText}\n`;
24087
+ render(status, error) {
24088
+ if (status === "rejected") {
24089
+ if (error?.cause) {
24090
+ console.log("\n");
24091
+ console.log(error.cause);
24092
+ }
24093
+ return `[${chalk.red("✗")}] ${this.progressText}\n${chalk.red(error ? error.message : "unknown error occured")}\n`;
24094
+ }
24095
+ if (status === "pending") return `[${this.spinner.value()}] ${this.progressText}\n`;
24082
24096
  return `[${chalk.green("✓")}] ${this.successText}\n`;
24083
24097
  }
24084
24098
  };
@@ -25501,7 +25515,7 @@ var init_dist$3 = __esmMin((() => {
25501
25515
  }
25502
25516
  return t;
25503
25517
  }, "invertCase"), le = /* @__PURE__ */ new Map(), _e$3 = X((e, t) => {
25504
- const s = Ie.join(e, `.is-fs-case-sensitive-test-${process.pid}`);
25518
+ const s = path.join(e, `.is-fs-case-sensitive-test-${process.pid}`);
25505
25519
  try {
25506
25520
  return t.writeFileSync(s, ""), !t.existsSync(Ae(s));
25507
25521
  } finally {
@@ -26346,7 +26360,7 @@ var require_common$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
26346
26360
  return Object.prototype.hasOwnProperty.call(obj, field);
26347
26361
  }
26348
26362
  var fs$5 = __require("fs");
26349
- var path$5 = __require("path");
26363
+ var path$6 = __require("path");
26350
26364
  var minimatch = require_minimatch();
26351
26365
  var isAbsolute$2 = __require("path").isAbsolute;
26352
26366
  var Minimatch = minimatch.Minimatch;
@@ -26400,13 +26414,13 @@ var require_common$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
26400
26414
  setupIgnores(self, options);
26401
26415
  self.changedCwd = false;
26402
26416
  var cwd = process.cwd();
26403
- if (!ownProp(options, "cwd")) self.cwd = path$5.resolve(cwd);
26417
+ if (!ownProp(options, "cwd")) self.cwd = path$6.resolve(cwd);
26404
26418
  else {
26405
- self.cwd = path$5.resolve(options.cwd);
26419
+ self.cwd = path$6.resolve(options.cwd);
26406
26420
  self.changedCwd = self.cwd !== cwd;
26407
26421
  }
26408
- self.root = options.root || path$5.resolve(self.cwd, "/");
26409
- self.root = path$5.resolve(self.root);
26422
+ self.root = options.root || path$6.resolve(self.cwd, "/");
26423
+ self.root = path$6.resolve(self.root);
26410
26424
  self.cwdAbs = isAbsolute$2(self.cwd) ? self.cwd : makeAbs(self, self.cwd);
26411
26425
  self.nomount = !!options.nomount;
26412
26426
  if (process.platform === "win32") {
@@ -26473,10 +26487,10 @@ var require_common$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
26473
26487
  }
26474
26488
  function makeAbs(self, f) {
26475
26489
  var abs = f;
26476
- if (f.charAt(0) === "/") abs = path$5.join(self.root, f);
26490
+ if (f.charAt(0) === "/") abs = path$6.join(self.root, f);
26477
26491
  else if (isAbsolute$2(f) || f === "") abs = f;
26478
- else if (self.changedCwd) abs = path$5.resolve(self.cwd, f);
26479
- else abs = path$5.resolve(f);
26492
+ else if (self.changedCwd) abs = path$6.resolve(self.cwd, f);
26493
+ else abs = path$6.resolve(f);
26480
26494
  if (process.platform === "win32") abs = abs.replace(/\\/g, "/");
26481
26495
  return abs;
26482
26496
  }
@@ -26503,7 +26517,7 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26503
26517
  minimatch.Minimatch;
26504
26518
  require_glob().Glob;
26505
26519
  __require("util");
26506
- var path$4 = __require("path");
26520
+ var path$5 = __require("path");
26507
26521
  var assert$1 = __require("assert");
26508
26522
  var isAbsolute$1 = __require("path").isAbsolute;
26509
26523
  var common = require_common$1();
@@ -26599,7 +26613,7 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26599
26613
  var e = matchedEntries[i];
26600
26614
  if (prefix) if (prefix.slice(-1) !== "/") e = prefix + "/" + e;
26601
26615
  else e = prefix + e;
26602
- if (e.charAt(0) === "/" && !this.nomount) e = path$4.join(this.root, e);
26616
+ if (e.charAt(0) === "/" && !this.nomount) e = path$5.join(this.root, e);
26603
26617
  this._emitMatch(index, e);
26604
26618
  }
26605
26619
  return;
@@ -26714,9 +26728,9 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26714
26728
  if (!exists) return;
26715
26729
  if (prefix && isAbsolute$1(prefix) && !this.nomount) {
26716
26730
  var trail = /[\/\\]$/.test(prefix);
26717
- if (prefix.charAt(0) === "/") prefix = path$4.join(this.root, prefix);
26731
+ if (prefix.charAt(0) === "/") prefix = path$5.join(this.root, prefix);
26718
26732
  else {
26719
- prefix = path$4.resolve(this.root, prefix);
26733
+ prefix = path$5.resolve(this.root, prefix);
26720
26734
  if (trail) prefix += "/";
26721
26735
  }
26722
26736
  }
@@ -26877,7 +26891,7 @@ var require_glob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26877
26891
  minimatch.Minimatch;
26878
26892
  var inherits = require_inherits();
26879
26893
  var EE$3 = __require("events").EventEmitter;
26880
- var path$3 = __require("path");
26894
+ var path$4 = __require("path");
26881
26895
  var assert = __require("assert");
26882
26896
  var isAbsolute = __require("path").isAbsolute;
26883
26897
  var globSync = require_sync();
@@ -27108,7 +27122,7 @@ var require_glob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27108
27122
  var e = matchedEntries[i];
27109
27123
  if (prefix) if (prefix !== "/") e = prefix + "/" + e;
27110
27124
  else e = prefix + e;
27111
- if (e.charAt(0) === "/" && !this.nomount) e = path$3.join(this.root, e);
27125
+ if (e.charAt(0) === "/" && !this.nomount) e = path$4.join(this.root, e);
27112
27126
  this._emitMatch(index, e);
27113
27127
  }
27114
27128
  return cb();
@@ -27255,9 +27269,9 @@ var require_glob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27255
27269
  if (!exists) return cb();
27256
27270
  if (prefix && isAbsolute(prefix) && !this.nomount) {
27257
27271
  var trail = /[\/\\]$/.test(prefix);
27258
- if (prefix.charAt(0) === "/") prefix = path$3.join(this.root, prefix);
27272
+ if (prefix.charAt(0) === "/") prefix = path$4.join(this.root, prefix);
27259
27273
  else {
27260
- prefix = path$3.resolve(this.root, prefix);
27274
+ prefix = path$4.resolve(this.root, prefix);
27261
27275
  if (trail) prefix += "/";
27262
27276
  }
27263
27277
  }
@@ -76208,7 +76222,7 @@ var init_convertor = __esmMin((() => {
76208
76222
  alterUniqueConvertor = convertor("alter_unique", (st) => {
76209
76223
  const statements = [];
76210
76224
  statements.push(dropUniqueConvertor.convert({ unique: st.diff.$left }));
76211
- statements.push(addUniqueConvertor.convert({ unique: st.diff.$left }));
76225
+ statements.push(addUniqueConvertor.convert({ unique: st.diff.$right }));
76212
76226
  return statements;
76213
76227
  });
76214
76228
  createEnumConvertor = convertor("create_enum", (st) => {
@@ -83638,7 +83652,7 @@ var require_constants$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83638
83652
  //#region ../node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js
83639
83653
  var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83640
83654
  var fs$4 = __require("fs");
83641
- var path$2 = __require("path");
83655
+ var path$3 = __require("path");
83642
83656
  var os$3 = __require("os");
83643
83657
  var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
83644
83658
  var vars = process.config && process.config.variables || {};
@@ -83655,20 +83669,20 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
83655
83669
  return runtimeRequire(load.resolve(dir));
83656
83670
  }
83657
83671
  load.resolve = load.path = function(dir) {
83658
- dir = path$2.resolve(dir || ".");
83672
+ dir = path$3.resolve(dir || ".");
83659
83673
  try {
83660
- var name = runtimeRequire(path$2.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
83674
+ var name = runtimeRequire(path$3.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
83661
83675
  if (process.env[name + "_PREBUILD"]) dir = process.env[name + "_PREBUILD"];
83662
83676
  } catch (err) {}
83663
83677
  if (!prebuildsOnly) {
83664
- var release = getFirst(path$2.join(dir, "build/Release"), matchBuild);
83678
+ var release = getFirst(path$3.join(dir, "build/Release"), matchBuild);
83665
83679
  if (release) return release;
83666
- var debug = getFirst(path$2.join(dir, "build/Debug"), matchBuild);
83680
+ var debug = getFirst(path$3.join(dir, "build/Debug"), matchBuild);
83667
83681
  if (debug) return debug;
83668
83682
  }
83669
83683
  var prebuild = resolve(dir);
83670
83684
  if (prebuild) return prebuild;
83671
- var nearby = resolve(path$2.dirname(process.execPath));
83685
+ var nearby = resolve(path$3.dirname(process.execPath));
83672
83686
  if (nearby) return nearby;
83673
83687
  var target = [
83674
83688
  "platform=" + platform,
@@ -83684,11 +83698,11 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
83684
83698
  ].filter(Boolean).join(" ");
83685
83699
  throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
83686
83700
  function resolve(dir) {
83687
- var tuple = readdirSync(path$2.join(dir, "prebuilds")).map(parseTuple).filter(matchTuple(platform, arch)).sort(compareTuples)[0];
83701
+ var tuple = readdirSync(path$3.join(dir, "prebuilds")).map(parseTuple).filter(matchTuple(platform, arch)).sort(compareTuples)[0];
83688
83702
  if (!tuple) return;
83689
- var prebuilds = path$2.join(dir, "prebuilds", tuple.name);
83703
+ var prebuilds = path$3.join(dir, "prebuilds", tuple.name);
83690
83704
  var winner = readdirSync(prebuilds).map(parseTags).filter(matchTags(runtime, abi)).sort(compareTags(runtime))[0];
83691
- if (winner) return path$2.join(prebuilds, winner.file);
83705
+ if (winner) return path$3.join(prebuilds, winner.file);
83692
83706
  }
83693
83707
  };
83694
83708
  function readdirSync(dir) {
@@ -83700,7 +83714,7 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
83700
83714
  }
83701
83715
  function getFirst(dir, filter) {
83702
83716
  var files = readdirSync(dir).filter(filter);
83703
- return files[0] && path$2.join(dir, files[0]);
83717
+ return files[0] && path$3.join(dir, files[0]);
83704
83718
  }
83705
83719
  function matchBuild(name) {
83706
83720
  return /\.node$/.test(name);
@@ -100008,7 +100022,7 @@ var require_dist_cjs$22 = /* @__PURE__ */ __commonJSMin(((exports) => {
100008
100022
  var getHomeDir = require_getHomeDir();
100009
100023
  var getSSOTokenFilepath = require_getSSOTokenFilepath();
100010
100024
  var getSSOTokenFromFile = require_getSSOTokenFromFile();
100011
- var path$1 = __require("path");
100025
+ var path$2 = __require("path");
100012
100026
  var types = require_dist_cjs$53();
100013
100027
  var readFile = require_readFile();
100014
100028
  const ENV_PROFILE = "AWS_PROFILE";
@@ -100026,9 +100040,9 @@ var require_dist_cjs$22 = /* @__PURE__ */ __commonJSMin(((exports) => {
100026
100040
  return acc;
100027
100041
  }, { ...data.default && { default: data.default } });
100028
100042
  const ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
100029
- const getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path$1.join(getHomeDir.getHomeDir(), ".aws", "config");
100043
+ const getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path$2.join(getHomeDir.getHomeDir(), ".aws", "config");
100030
100044
  const ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
100031
- const getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path$1.join(getHomeDir.getHomeDir(), ".aws", "credentials");
100045
+ const getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path$2.join(getHomeDir.getHomeDir(), ".aws", "credentials");
100032
100046
  const prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
100033
100047
  const profileNameBlockList = ["__proto__", "profile __proto__"];
100034
100048
  const parseIni = (iniData) => {
@@ -100069,9 +100083,9 @@ var require_dist_cjs$22 = /* @__PURE__ */ __commonJSMin(((exports) => {
100069
100083
  const homeDir = getHomeDir.getHomeDir();
100070
100084
  const relativeHomeDirPrefix = "~/";
100071
100085
  let resolvedFilepath = filepath;
100072
- if (filepath.startsWith(relativeHomeDirPrefix)) resolvedFilepath = path$1.join(homeDir, filepath.slice(2));
100086
+ if (filepath.startsWith(relativeHomeDirPrefix)) resolvedFilepath = path$2.join(homeDir, filepath.slice(2));
100073
100087
  let resolvedConfigFilepath = configFilepath;
100074
- if (configFilepath.startsWith(relativeHomeDirPrefix)) resolvedConfigFilepath = path$1.join(homeDir, configFilepath.slice(2));
100088
+ if (configFilepath.startsWith(relativeHomeDirPrefix)) resolvedConfigFilepath = path$2.join(homeDir, configFilepath.slice(2));
100075
100089
  const parsedFiles = await Promise.all([readFile.readFile(resolvedConfigFilepath, { ignoreCache: init.ignoreCache }).then(parseIni).then(getConfigData).catch(swallowError$1), readFile.readFile(resolvedFilepath, { ignoreCache: init.ignoreCache }).then(parseIni).catch(swallowError$1)]);
100076
100090
  return {
100077
100091
  configFile: parsedFiles[0],
@@ -161367,7 +161381,7 @@ var require_msal_node = /* @__PURE__ */ __commonJSMin(((exports) => {
161367
161381
  var msalCommon = require_lib$1();
161368
161382
  var jwt = require_jsonwebtoken();
161369
161383
  var fs$2 = __require("fs");
161370
- var path = __require("path");
161384
+ var path$1 = __require("path");
161371
161385
  /**
161372
161386
  * This class serializes cache entities to be saved into in-memory object types defined internally
161373
161387
  * @internal
@@ -170750,7 +170764,7 @@ Content-Length: ${body.length}\r\n\r\n${body}`;
170750
170764
  const secretFilePath = wwwAuthHeader.split("Basic realm=")[1];
170751
170765
  if (!SUPPORTED_AZURE_ARC_PLATFORMS.hasOwnProperty(process.platform)) throw createManagedIdentityError(platformNotSupported);
170752
170766
  const expectedSecretFilePath = SUPPORTED_AZURE_ARC_PLATFORMS[process.platform];
170753
- const fileName = path.basename(secretFilePath);
170767
+ const fileName = path$1.basename(secretFilePath);
170754
170768
  if (!fileName.endsWith(".key")) throw createManagedIdentityError(invalidFileExtension);
170755
170769
  if (expectedSecretFilePath + fileName !== secretFilePath) throw createManagedIdentityError(invalidFilePath);
170756
170770
  let secretFileSize;
@@ -219353,7 +219367,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
219353
219367
  const { driver } = credentials;
219354
219368
  if (driver === "d1-http") {
219355
219369
  const { drizzle } = await import("drizzle-orm/sqlite-proxy");
219356
- const { migrate } = await import("drizzle-orm/sqlite-proxy/migrator");
219370
+ const { migrateInternal } = await import("drizzle-orm/sqlite-proxy/migrator.internal");
219357
219371
  const remoteCallback = async (sql, params, method) => {
219358
219372
  const data = await (await fetch$1(`https://api.cloudflare.com/client/v4/accounts/${credentials.accountId}/d1/database/${credentials.databaseId}/${method === "values" ? "raw" : "query"}`, {
219359
219373
  method: "POST",
@@ -219390,9 +219404,9 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
219390
219404
  };
219391
219405
  const drzl = drizzle(remoteCallback);
219392
219406
  const migrateFn = async (config) => {
219393
- return migrate(drzl, async (queries) => {
219407
+ return migrateInternal(drzl, async (queries) => {
219394
219408
  for (const query of queries) await remoteCallback(query, [], "run");
219395
- }, config);
219409
+ }, config, "run");
219396
219410
  };
219397
219411
  const query = async (sql, params) => {
219398
219412
  return (await remoteCallback(sql, params || [], "all")).rows;
@@ -221668,13 +221682,13 @@ var init_generate_common = __esmMin((() => {
221668
221682
  const js = embeddedMigrations([...snapshots || [], join(outFolder, `${tag}/snapshot.json`)], driver);
221669
221683
  fs.writeFileSync(`${outFolder}/migrations.js`, js);
221670
221684
  }
221671
- (0, import_hanji$2.render)(`[${chalk.green("✓")}] Your SQL migration ➜ ${chalk.bold.underline.blue(Ie.join(`${outFolder}/${tag}/migration.sql`))} 🚀`);
221685
+ (0, import_hanji$2.render)(`[${chalk.green("✓")}] Your SQL migration ➜ ${chalk.bold.underline.blue(path.join(`${outFolder}/${tag}/migration.sql`))} 🚀`);
221672
221686
  };
221673
221687
  embeddedMigrations = (snapshots, driver) => {
221674
221688
  let content = driver === "expo" ? "// This file is required for Expo/React Native SQLite migrations - https://orm.drizzle.team/quick-sqlite/expo\n\n" : "";
221675
221689
  const migrations = {};
221676
221690
  snapshots.forEach((entry, idx) => {
221677
- const prefix = entry.split("/")[entry.split("/").length - 2];
221691
+ const prefix = entry.split(path.sep)[entry.split(path.sep).length - 2];
221678
221692
  const importName = idx.toString().padStart(4, "0");
221679
221693
  content += `import m${importName} from './${prefix}/migration.sql';\n`;
221680
221694
  migrations[prefix] = importName;
@@ -222129,7 +222143,7 @@ var init_pull_common = __esmMin((() => {
222129
222143
  };
222130
222144
  relationsToTypeScript = (schema, casing, schemaPath) => {
222131
222145
  const imports = [];
222132
- const tableRelations = {};
222146
+ const tableRelations = Object.create(null);
222133
222147
  schema.forEach((table) => {
222134
222148
  const fks = Object.values(table.foreignKeys);
222135
222149
  const tableColumns = table.columns?.map((it) => withCasing(it.name, casing)) ?? [];
package/api-sqlite.js CHANGED
@@ -6,7 +6,7 @@ const startStudioServer = async (imports, credentials, options) => {
6
6
  const { is } = require("drizzle-orm");
7
7
  const { SQLiteTable } = require("drizzle-orm/sqlite-core");
8
8
  const { Relations } = require("drizzle-orm/_relations");
9
- const { drizzleForSQLite, prepareServer } = await Promise.resolve().then(() => require("./studio-BRMcKTKQ.js"));
9
+ const { drizzleForSQLite, prepareServer } = await Promise.resolve().then(() => require("./studio-6WVuyNxo.js"));
10
10
  const sqliteSchema = {};
11
11
  const relations = {};
12
12
  Object.entries(imports).forEach(([k, t]) => {
package/api-sqlite.mjs CHANGED
@@ -213394,7 +213394,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
213394
213394
  const { driver } = credentials;
213395
213395
  if (driver === "d1-http") {
213396
213396
  const { drizzle } = await import("drizzle-orm/sqlite-proxy");
213397
- const { migrate } = await import("drizzle-orm/sqlite-proxy/migrator");
213397
+ const { migrateInternal } = await import("drizzle-orm/sqlite-proxy/migrator.internal");
213398
213398
  const remoteCallback = async (sql, params, method) => {
213399
213399
  const data = await (await fetch$1(`https://api.cloudflare.com/client/v4/accounts/${credentials.accountId}/d1/database/${credentials.databaseId}/${method === "values" ? "raw" : "query"}`, {
213400
213400
  method: "POST",
@@ -213431,9 +213431,9 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
213431
213431
  };
213432
213432
  const drzl = drizzle(remoteCallback);
213433
213433
  const migrateFn = async (config) => {
213434
- return migrate(drzl, async (queries) => {
213434
+ return migrateInternal(drzl, async (queries) => {
213435
213435
  for (const query of queries) await remoteCallback(query, [], "run");
213436
- }, config);
213436
+ }, config, "run");
213437
213437
  };
213438
213438
  const query = async (sql, params) => {
213439
213439
  return (await remoteCallback(sql, params || [], "all")).rows;
package/bin.cjs CHANGED
@@ -29396,8 +29396,15 @@ const users = mysqlTable('users', {
29396
29396
  }, 128);
29397
29397
  this.on("detach", () => clearInterval(this.timeout));
29398
29398
  }
29399
- render(status) {
29400
- if (status === "pending" || status === "rejected") return `[${this.spinner.value()}] applying migrations...`;
29399
+ render(status, error) {
29400
+ if (status === "rejected") {
29401
+ if (error?.cause) {
29402
+ console.log("\n");
29403
+ console.log(error.cause);
29404
+ }
29405
+ return `[${chalk.red("✗")}] Error during migration:\n${chalk.red(error ? error.message : "unknown error occured")}\n`;
29406
+ }
29407
+ if (status === "pending") return `[${this.spinner.value()}] applying migrations...`;
29401
29408
  return `[${chalk.green("✓")}] migrations applied successfully!`;
29402
29409
  }
29403
29410
  };
@@ -29414,8 +29421,15 @@ const users = mysqlTable('users', {
29414
29421
  }, 128);
29415
29422
  this.on("detach", () => clearInterval(this.timeout));
29416
29423
  }
29417
- render(status) {
29418
- if (status === "pending" || status === "rejected") return `[${this.spinner.value()}] ${this.progressText}\n`;
29424
+ render(status, error) {
29425
+ if (status === "rejected") {
29426
+ if (error?.cause) {
29427
+ console.log("\n");
29428
+ console.log(error.cause);
29429
+ }
29430
+ return `[${chalk.red("✗")}] ${this.progressText}\n${chalk.red(error ? error.message : "unknown error occured")}\n`;
29431
+ }
29432
+ if (status === "pending") return `[${this.spinner.value()}] ${this.progressText}\n`;
29419
29433
  return `[${chalk.green("✓")}] ${this.successText}\n`;
29420
29434
  }
29421
29435
  };
@@ -80523,7 +80537,7 @@ var init_convertor$4 = __esmMin((() => {
80523
80537
  alterUniqueConvertor = convertor$4("alter_unique", (st) => {
80524
80538
  const statements = [];
80525
80539
  statements.push(dropUniqueConvertor.convert({ unique: st.diff.$left }));
80526
- statements.push(addUniqueConvertor.convert({ unique: st.diff.$left }));
80540
+ statements.push(addUniqueConvertor.convert({ unique: st.diff.$right }));
80527
80541
  return statements;
80528
80542
  });
80529
80543
  createEnumConvertor$1 = convertor$4("create_enum", (st) => {
@@ -85613,7 +85627,7 @@ var init_generate_common = __esmMin((() => {
85613
85627
  let content = driver === "expo" ? "// This file is required for Expo/React Native SQLite migrations - https://orm.drizzle.team/quick-sqlite/expo\n\n" : "";
85614
85628
  const migrations = {};
85615
85629
  snapshots.forEach((entry, idx) => {
85616
- const prefix = entry.split("/")[entry.split("/").length - 2];
85630
+ const prefix = entry.split(path.default.sep)[entry.split(path.default.sep).length - 2];
85617
85631
  const importName = idx.toString().padStart(4, "0");
85618
85632
  content += `import m${importName} from './${prefix}/migration.sql';\n`;
85619
85633
  migrations[prefix] = importName;
@@ -92717,7 +92731,7 @@ var init_drizzle$1 = __esmMin((() => {
92717
92731
  });
92718
92732
  continue;
92719
92733
  }
92720
- let where = index.config.where ? dialect.sqlToQuery(index.config.where).sql : "";
92734
+ let where = index.config.where ? dialect.sqlToQuery(index.config.where, "indexes").sql : "";
92721
92735
  where = where === "true" ? "" : where;
92722
92736
  result.indexes.push({
92723
92737
  entityType: "indexes",
@@ -234471,7 +234485,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
234471
234485
  const { driver } = credentials;
234472
234486
  if (driver === "d1-http") {
234473
234487
  const { drizzle } = await import("drizzle-orm/sqlite-proxy");
234474
- const { migrate } = await import("drizzle-orm/sqlite-proxy/migrator");
234488
+ const { migrateInternal } = await import("drizzle-orm/sqlite-proxy/migrator.internal");
234475
234489
  const remoteCallback = async (sql, params, method) => {
234476
234490
  const data = await (await fetch$1(`https://api.cloudflare.com/client/v4/accounts/${credentials.accountId}/d1/database/${credentials.databaseId}/${method === "values" ? "raw" : "query"}`, {
234477
234491
  method: "POST",
@@ -234508,9 +234522,9 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
234508
234522
  };
234509
234523
  const drzl = drizzle(remoteCallback);
234510
234524
  const migrateFn = async (config) => {
234511
- return migrate(drzl, async (queries) => {
234525
+ return migrateInternal(drzl, async (queries) => {
234512
234526
  for (const query of queries) await remoteCallback(query, [], "run");
234513
- }, config);
234527
+ }, config, "run");
234514
234528
  };
234515
234529
  const query = async (sql, params) => {
234516
234530
  return (await remoteCallback(sql, params || [], "all")).rows;
@@ -236352,12 +236366,15 @@ var init_introspect$4 = __esmMin((() => {
236352
236366
  const algorithmMatch = createSqlStatement["Create View"].match(/ALGORITHM=([^ ]+)/);
236353
236367
  const algorithm = algorithmMatch ? algorithmMatch[1].toLowerCase() : null;
236354
236368
  const viewColumns = columns.filter((it) => it["TABLE_NAME"] === name);
236355
- for (const column of viewColumns) res.viewColumns.push({
236356
- view: name,
236357
- name: column["COLUMN_NAME"],
236358
- notNull: column["IS_NULLABLE"] === "NO",
236359
- type: column["DATA_TYPE"]
236360
- });
236369
+ for (const column of viewColumns) {
236370
+ const columnType = column["COLUMN_TYPE"].replace("decimal(10,0)", "decimal");
236371
+ res.viewColumns.push({
236372
+ view: name,
236373
+ name: column["COLUMN_NAME"],
236374
+ notNull: column["IS_NULLABLE"] === "NO",
236375
+ type: columnType
236376
+ });
236377
+ }
236361
236378
  res.views.push({
236362
236379
  entityType: "views",
236363
236380
  name,
@@ -237503,7 +237520,7 @@ var init_pull_common = __esmMin((() => {
237503
237520
  };
237504
237521
  relationsToTypeScript = (schema, casing, schemaPath) => {
237505
237522
  const imports = [];
237506
- const tableRelations = {};
237523
+ const tableRelations = Object.create(null);
237507
237524
  schema.forEach((table) => {
237508
237525
  const fks = Object.values(table.foreignKeys);
237509
237526
  const tableColumns = table.columns?.map((it) => withCasing$3(it.name, casing)) ?? [];
@@ -245405,7 +245422,7 @@ init_views();
245405
245422
  const version = async () => {
245406
245423
  const { npmVersion } = await ormCoreVersions();
245407
245424
  const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
245408
- const envVersion = "1.0.0-beta.21";
245425
+ const envVersion = "1.0.0-beta.22";
245409
245426
  const versions = `drizzle-kit: ${envVersion ? `v${envVersion}` : "--"}\n${ormVersion}`;
245410
245427
  console.log(chalk.gray(versions), "\n");
245411
245428
  };
@@ -7538,7 +7538,7 @@ const connectToSQLite = async (credentials) => {
7538
7538
  const { driver } = credentials;
7539
7539
  if (driver === "d1-http") {
7540
7540
  const { drizzle } = await import("drizzle-orm/sqlite-proxy");
7541
- const { migrate } = await import("drizzle-orm/sqlite-proxy/migrator");
7541
+ const { migrateInternal } = await import("drizzle-orm/sqlite-proxy/migrator.internal");
7542
7542
  const remoteCallback = async (sql, params, method) => {
7543
7543
  const data = await (await fetch(`https://api.cloudflare.com/client/v4/accounts/${credentials.accountId}/d1/database/${credentials.databaseId}/${method === "values" ? "raw" : "query"}`, {
7544
7544
  method: "POST",
@@ -7575,9 +7575,9 @@ const connectToSQLite = async (credentials) => {
7575
7575
  };
7576
7576
  const drzl = drizzle(remoteCallback);
7577
7577
  const migrateFn = async (config) => {
7578
- return migrate(drzl, async (queries) => {
7578
+ return migrateInternal(drzl, async (queries) => {
7579
7579
  for (const query of queries) await remoteCallback(query, [], "run");
7580
- }, config);
7580
+ }, config, "run");
7581
7581
  };
7582
7582
  const query = async (sql, params) => {
7583
7583
  return (await remoteCallback(sql, params || [], "all")).rows;
@@ -544,7 +544,7 @@ const dropUniqueConvertor = convertor("drop_unique", (st) => {
544
544
  const alterUniqueConvertor = convertor("alter_unique", (st) => {
545
545
  const statements = [];
546
546
  statements.push(dropUniqueConvertor.convert({ unique: st.diff.$left }));
547
- statements.push(addUniqueConvertor.convert({ unique: st.diff.$left }));
547
+ statements.push(addUniqueConvertor.convert({ unique: st.diff.$right }));
548
548
  return statements;
549
549
  });
550
550
  const createEnumConvertor = convertor("create_enum", (st) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "1.0.0-beta.21",
3
+ "version": "1.0.0-beta.22-1b8fcb2",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
@@ -5,7 +5,7 @@ const require_views = require('./views-DkfVL_-7.js');
5
5
  require('./snapshot-CHMNRJxo.js');
6
6
  require('./brace-expansion-CQ04dhdS.js');
7
7
  require('./pull-utils-C1It_bwt.js');
8
- require('./diff-BQc-7Nm8.js');
8
+ require('./diff-BHBkEJHk.js');
9
9
  require('./utils-node-DWTi1mTL.js');
10
10
  require('./prompts-DfsG1lFx.js');
11
11
  require('./drizzle-Bj7v9CEh.js');
@@ -1966,7 +1966,7 @@ const getCustomDefaults = (schema, casing) => {
1966
1966
  return customDefaults;
1967
1967
  };
1968
1968
  const drizzleForPostgres = async (credentials, pgSchema, relations, schemaFiles, casing) => {
1969
- const { preparePostgresDB } = await Promise.resolve().then(() => require("./connections-DRQjaCx9.js"));
1969
+ const { preparePostgresDB } = await Promise.resolve().then(() => require("./connections-DF80m0CP.js"));
1970
1970
  const db = await preparePostgresDB(credentials);
1971
1971
  const customDefaults = getCustomDefaults(pgSchema, casing);
1972
1972
  let dbUrl;
@@ -1993,7 +1993,7 @@ const drizzleForPostgres = async (credentials, pgSchema, relations, schemaFiles,
1993
1993
  };
1994
1994
  };
1995
1995
  const drizzleForMySQL = async (credentials, mysqlSchema, relations, schemaFiles, casing) => {
1996
- const { connectToMySQL } = await Promise.resolve().then(() => require("./connections-DRQjaCx9.js"));
1996
+ const { connectToMySQL } = await Promise.resolve().then(() => require("./connections-DF80m0CP.js"));
1997
1997
  const { proxy, transactionProxy, benchmarkProxy, database, packageName } = await connectToMySQL(credentials);
1998
1998
  const customDefaults = getCustomDefaults(mysqlSchema, casing);
1999
1999
  let dbUrl;
@@ -2017,7 +2017,7 @@ const drizzleForMySQL = async (credentials, mysqlSchema, relations, schemaFiles,
2017
2017
  const drizzleForSQLite = async (credentials, sqliteSchema, relations, schemaFiles, casing) => {
2018
2018
  const customDefaults = getCustomDefaults(sqliteSchema, casing);
2019
2019
  if ("driver" in credentials && credentials.driver === "d1") {
2020
- const { connectToD1 } = await Promise.resolve().then(() => require("./connections-DRQjaCx9.js"));
2020
+ const { connectToD1 } = await Promise.resolve().then(() => require("./connections-DF80m0CP.js"));
2021
2021
  const sqliteDB = await connectToD1(credentials.binding);
2022
2022
  return {
2023
2023
  dbHash: (0, crypto$1.createHash)("sha256").update("d1://binding").digest("hex"),
@@ -2033,7 +2033,7 @@ const drizzleForSQLite = async (credentials, sqliteSchema, relations, schemaFile
2033
2033
  casing
2034
2034
  };
2035
2035
  }
2036
- const { connectToSQLite } = await Promise.resolve().then(() => require("./connections-DRQjaCx9.js"));
2036
+ const { connectToSQLite } = await Promise.resolve().then(() => require("./connections-DF80m0CP.js"));
2037
2037
  const sqliteDB = await connectToSQLite(credentials);
2038
2038
  let dbUrl;
2039
2039
  if ("driver" in credentials) {