@prisma/migrate 6.6.0-integration-mcp.3 → 6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.5

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/dist/bin.js CHANGED
@@ -28,13 +28,13 @@ var import_chunk_O723A5JE = require("./chunk-O723A5JE.js");
28
28
  var import_chunk_KN2W5IP7 = require("./chunk-KN2W5IP7.js");
29
29
  var import_chunk_GKHRL6AR = require("./chunk-GKHRL6AR.js");
30
30
  var import_chunk_GAKKKF5T = require("./chunk-GAKKKF5T.js");
31
- var import_chunk_ZJ4IDCRR = require("./chunk-ZJ4IDCRR.js");
31
+ var import_chunk_QJT4H5N6 = require("./chunk-QJT4H5N6.js");
32
32
  var import_chunk_IINN7QUV = require("./chunk-IINN7QUV.js");
33
+ var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
33
34
  var import_chunk_RR6BKMNO = require("./chunk-RR6BKMNO.js");
34
35
  var import_chunk_RTGQXNX6 = require("./chunk-RTGQXNX6.js");
35
36
  var import_chunk_AI6DH66U = require("./chunk-AI6DH66U.js");
36
37
  var import_chunk_AHJ2N6BJ = require("./chunk-AHJ2N6BJ.js");
37
- var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
38
38
  var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
39
39
  var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
40
40
  var import_chunk_3PIR4R46 = require("./chunk-3PIR4R46.js");
@@ -48,9 +48,9 @@ var import_chunk_5LKIRKDL = require("./chunk-5LKIRKDL.js");
48
48
  var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
49
49
  var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
50
50
  var import_chunk_2R6DII47 = require("./chunk-2R6DII47.js");
51
- var import_chunk_NXCH5SQP = require("./chunk-NXCH5SQP.js");
52
- var import_chunk_4RKCE4QB = require("./chunk-4RKCE4QB.js");
51
+ var import_chunk_XPDKMCDT = require("./chunk-XPDKMCDT.js");
53
52
  var import_chunk_33LPBNDX = require("./chunk-33LPBNDX.js");
53
+ var import_chunk_ZB5NPOJW = require("./chunk-ZB5NPOJW.js");
54
54
  var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
55
55
  var import_chunk_PDCXVUV3 = require("./chunk-PDCXVUV3.js");
56
56
  var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
@@ -70,7 +70,7 @@ var import_config = require("@prisma/config");
70
70
  var import_debug = __toESM(require("@prisma/debug"));
71
71
  var import_engines_version = require("@prisma/engines-version");
72
72
  var import_internals = require("@prisma/internals");
73
- var version = "6.6.0-integration-mcp.3";
73
+ var version = "6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.5";
74
74
  process.on("uncaughtException", (e) => {
75
75
  console.log(e);
76
76
  });
@@ -97,11 +97,11 @@ async function main() {
97
97
  resolve: import_chunk_KN2W5IP7.MigrateResolve.new(),
98
98
  reset: import_chunk_O723A5JE.MigrateReset.new(),
99
99
  deploy: import_chunk_HHVLUI3H.MigrateDeploy.new(),
100
- diff: import_chunk_NXCH5SQP.MigrateDiff.new()
100
+ diff: import_chunk_XPDKMCDT.MigrateDiff.new()
101
101
  }),
102
102
  db: import_chunk_EJG7GKM7.DbCommand.new({
103
103
  execute: import_chunk_GAKKKF5T.DbExecute.new(),
104
- pull: import_chunk_ZJ4IDCRR.DbPull.new(),
104
+ pull: import_chunk_QJT4H5N6.DbPull.new(),
105
105
  push: import_chunk_3PIR4R46.DbPush.new(),
106
106
  // drop: DbDrop.new(),
107
107
  seed: import_chunk_B4SUSDC2.DbSeed.new()
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_GKDFIHM2_exports = {};
30
+ __export(chunk_GKDFIHM2_exports, {
31
+ getSchemaPathAndPrint: () => getSchemaPathAndPrint,
32
+ printSchemaLoadedMessage: () => printSchemaLoadedMessage
33
+ });
34
+ module.exports = __toCommonJS(chunk_GKDFIHM2_exports);
35
+ var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
36
+ var import_internals = require("@prisma/internals");
37
+ var import_path = __toESM(require("path"));
38
+ async function getSchemaPathAndPrint(schemaPathProvided, schemaPathFromConfig, options) {
39
+ const schemaPathResult = await (0, import_internals.getSchemaWithPath)(schemaPathProvided, schemaPathFromConfig, options);
40
+ printSchemaLoadedMessage(schemaPathResult.schemaPath);
41
+ return schemaPathResult;
42
+ }
43
+ function printSchemaLoadedMessage(schemaPath) {
44
+ process.stdout.write((0, import_chunk_SKRR5WT4.dim)(`Prisma schema loaded from ${import_path.default.relative(process.cwd(), schemaPath)}`) + "\n");
45
+ }
@@ -26,13 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_QSSFEJHM_exports = {};
30
- __export(chunk_QSSFEJHM_exports, {
29
+ var chunk_L53C3AX3_exports = {};
30
+ __export(chunk_L53C3AX3_exports, {
31
31
  MigrateDiff: () => MigrateDiff
32
32
  });
33
- module.exports = __toCommonJS(chunk_QSSFEJHM_exports);
34
- var import_chunk_4RKCE4QB = require("./chunk-4RKCE4QB.js");
33
+ module.exports = __toCommonJS(chunk_L53C3AX3_exports);
35
34
  var import_chunk_33LPBNDX = require("./chunk-33LPBNDX.js");
35
+ var import_chunk_ZB5NPOJW = require("./chunk-ZB5NPOJW.js");
36
36
  var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
37
37
  var import_chunk_PDCXVUV3 = require("./chunk-PDCXVUV3.js");
38
38
  var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
@@ -9335,12 +9335,93 @@ var require_lib5 = (0, import_chunk_2ESYSVXG.__commonJS)({
9335
9335
  module2.exports = GitHost;
9336
9336
  }
9337
9337
  });
9338
+ var require_implementation = (0, import_chunk_2ESYSVXG.__commonJS)({
9339
+ "../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports, module2) {
9340
+ "use strict";
9341
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
9342
+ var toStr = Object.prototype.toString;
9343
+ var max = Math.max;
9344
+ var funcType = "[object Function]";
9345
+ var concatty = function concatty2(a, b) {
9346
+ var arr = [];
9347
+ for (var i = 0; i < a.length; i += 1) {
9348
+ arr[i] = a[i];
9349
+ }
9350
+ for (var j = 0; j < b.length; j += 1) {
9351
+ arr[j + a.length] = b[j];
9352
+ }
9353
+ return arr;
9354
+ };
9355
+ var slicy = function slicy2(arrLike, offset) {
9356
+ var arr = [];
9357
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
9358
+ arr[j] = arrLike[i];
9359
+ }
9360
+ return arr;
9361
+ };
9362
+ var joiny = function(arr, joiner) {
9363
+ var str = "";
9364
+ for (var i = 0; i < arr.length; i += 1) {
9365
+ str += arr[i];
9366
+ if (i + 1 < arr.length) {
9367
+ str += joiner;
9368
+ }
9369
+ }
9370
+ return str;
9371
+ };
9372
+ module2.exports = function bind2(that) {
9373
+ var target = this;
9374
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) {
9375
+ throw new TypeError(ERROR_MESSAGE + target);
9376
+ }
9377
+ var args = slicy(arguments, 1);
9378
+ var bound;
9379
+ var binder = function() {
9380
+ if (this instanceof bound) {
9381
+ var result = target.apply(
9382
+ this,
9383
+ concatty(args, arguments)
9384
+ );
9385
+ if (Object(result) === result) {
9386
+ return result;
9387
+ }
9388
+ return this;
9389
+ }
9390
+ return target.apply(
9391
+ that,
9392
+ concatty(args, arguments)
9393
+ );
9394
+ };
9395
+ var boundLength = max(0, target.length - args.length);
9396
+ var boundArgs = [];
9397
+ for (var i = 0; i < boundLength; i++) {
9398
+ boundArgs[i] = "$" + i;
9399
+ }
9400
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
9401
+ if (target.prototype) {
9402
+ var Empty = function Empty2() {
9403
+ };
9404
+ Empty.prototype = target.prototype;
9405
+ bound.prototype = new Empty();
9406
+ Empty.prototype = null;
9407
+ }
9408
+ return bound;
9409
+ };
9410
+ }
9411
+ });
9412
+ var require_function_bind = (0, import_chunk_2ESYSVXG.__commonJS)({
9413
+ "../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports, module2) {
9414
+ "use strict";
9415
+ var implementation = require_implementation();
9416
+ module2.exports = Function.prototype.bind || implementation;
9417
+ }
9418
+ });
9338
9419
  var require_hasown = (0, import_chunk_2ESYSVXG.__commonJS)({
9339
9420
  "../../node_modules/.pnpm/hasown@2.0.0/node_modules/hasown/index.js"(exports, module2) {
9340
9421
  "use strict";
9341
9422
  var call = Function.prototype.call;
9342
9423
  var $hasOwn = Object.prototype.hasOwnProperty;
9343
- var bind2 = (0, import_chunk_4RKCE4QB.require_function_bind)();
9424
+ var bind2 = require_function_bind();
9344
9425
  module2.exports = bind2.call(call, $hasOwn);
9345
9426
  }
9346
9427
  });
@@ -9624,8 +9705,8 @@ var require_typos = (0, import_chunk_2ESYSVXG.__commonJS)({
9624
9705
  var require_fixer = (0, import_chunk_2ESYSVXG.__commonJS)({
9625
9706
  "../../node_modules/.pnpm/normalize-package-data@6.0.0/node_modules/normalize-package-data/lib/fixer.js"(exports, module2) {
9626
9707
  "use strict";
9627
- var isValidSemver = (0, import_chunk_4RKCE4QB.require_valid)();
9628
- var cleanSemver = (0, import_chunk_4RKCE4QB.require_clean)();
9708
+ var isValidSemver = (0, import_chunk_ZB5NPOJW.require_valid)();
9709
+ var cleanSemver = (0, import_chunk_ZB5NPOJW.require_clean)();
9629
9710
  var validateLicense = require_validate_npm_package_license();
9630
9711
  var hostedGitInfo = require_lib5();
9631
9712
  var isBuiltinModule = require_is_core_module();
@@ -10258,7 +10339,7 @@ var require_package = (0, import_chunk_2ESYSVXG.__commonJS)({
10258
10339
  "@prisma/generator": "workspace:*",
10259
10340
  "@prisma/generator-helper": "workspace:*",
10260
10341
  "@prisma/get-platform": "workspace:*",
10261
- "@prisma/prisma-schema-wasm": "6.6.0-26.47cb872770bc2c9ff45909bd09f7326df36d9130",
10342
+ "@prisma/prisma-schema-wasm": "6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04",
10262
10343
  "@prisma/schema-files-loader": "workspace:*",
10263
10344
  arg: "5.0.2",
10264
10345
  prompts: "2.4.2"
@@ -10904,16 +10985,15 @@ function renderLookupError(error) {
10904
10985
  function renderDefaultLookupError(error, cwd) {
10905
10986
  const parts = [
10906
10987
  `Could not find Prisma Schema that is required for this command.`,
10907
- `You can either provide it with ${(0, import_chunk_SKRR5WT4.green)("`--schema`")} argument,`,
10908
- `set it in your ${(0, import_chunk_SKRR5WT4.green)("`prisma.config.ts`")},`,
10909
- `set it as ${(0, import_chunk_SKRR5WT4.green)("`prisma.schema`")} in your ${(0, import_chunk_SKRR5WT4.green)("package.json")},`,
10910
- `or put it into the default location (${(0, import_chunk_SKRR5WT4.green)("`./prisma/schema.prisma`")}, or ${(0, import_chunk_SKRR5WT4.green)("`./schema.prisma`")}.`,
10988
+ `You can either provide it with ${(0, import_chunk_SKRR5WT4.green)(
10989
+ "`--schema`"
10990
+ )} argument, set it as \`prisma.schema\` in your package.json or put it into the default location.`,
10911
10991
  "Checked following paths:\n"
10912
10992
  ];
10913
10993
  const printedPaths = /* @__PURE__ */ new Set();
10914
10994
  for (const failure of error.failures) {
10915
- const filePath = failure.path;
10916
- if (!printedPaths.has(failure.path)) {
10995
+ const filePath = failure.rule.schemaPath.path;
10996
+ if (!printedPaths.has(failure.rule.schemaPath.path)) {
10917
10997
  parts.push(`${import_path2.default.relative(cwd, filePath)}: ${renderLookupError(failure.error)}`);
10918
10998
  printedPaths.add(filePath);
10919
10999
  }
@@ -10939,13 +11019,21 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
10939
11019
  error: { kind: "PrismaConfigNotConfigured" }
10940
11020
  };
10941
11021
  }
10942
- const schemaResult = await readSchemaFromFileOrDirectory(schemaPathFromConfig);
10943
- if (!schemaResult.ok) {
10944
- throw new Error(
10945
- `Could not load schema from \`${schemaPathFromConfig}\` provided by "prisma.config.ts"\`: ${renderLookupError(
10946
- schemaResult.error
10947
- )}`
10948
- );
11022
+ let schemaResult;
11023
+ if (schemaPathFromConfig.kind === "single") {
11024
+ schemaResult = await readSchemaFromSingleFile(schemaPathFromConfig.filePath);
11025
+ if (!schemaResult.ok) {
11026
+ throw new Error(
11027
+ `Could not load schema from file \`${schemaPathFromConfig.filePath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
11028
+ );
11029
+ }
11030
+ } else {
11031
+ schemaResult = await readSchemaFromDirectory(schemaPathFromConfig.folderPath);
11032
+ if (!schemaResult.ok) {
11033
+ throw new Error(
11034
+ `Could not load schema from folder \`${schemaPathFromConfig.folderPath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
11035
+ );
11036
+ }
10949
11037
  }
10950
11038
  return schemaResult;
10951
11039
  }
@@ -10980,14 +11068,51 @@ async function getSchemaFromPackageJson(cwd) {
10980
11068
  return lookupResult;
10981
11069
  }
10982
11070
  async function getDefaultSchema(cwd, failures = []) {
10983
- const lookupPaths = [import_path2.default.join(cwd, "schema.prisma"), import_path2.default.join(cwd, "prisma", "schema.prisma")];
10984
- for (const path7 of lookupPaths) {
10985
- debug2(`Checking existence of ${path7}`);
10986
- const schema = await readSchemaFromSingleFile(path7);
11071
+ const schemaPrisma = {
11072
+ schemaPath: {
11073
+ path: import_path2.default.join(cwd, "schema.prisma"),
11074
+ kind: "file"
11075
+ }
11076
+ };
11077
+ const prismaSchemaFile = {
11078
+ schemaPath: {
11079
+ path: import_path2.default.join(cwd, "prisma", "schema.prisma"),
11080
+ kind: "file"
11081
+ },
11082
+ conflictsWith: {
11083
+ path: import_path2.default.join(cwd, "prisma", "schema"),
11084
+ kind: "directory"
11085
+ }
11086
+ };
11087
+ const prismaSchemaFolder = {
11088
+ schemaPath: {
11089
+ path: import_path2.default.join(cwd, "prisma", "schema"),
11090
+ kind: "directory"
11091
+ },
11092
+ conflictsWith: {
11093
+ path: import_path2.default.join(cwd, "prisma", "schema.prisma"),
11094
+ kind: "file"
11095
+ }
11096
+ };
11097
+ const rules = [schemaPrisma, prismaSchemaFile, prismaSchemaFolder];
11098
+ for (const rule of rules) {
11099
+ debug2(`Checking existence of ${rule.schemaPath.path}`);
11100
+ const schema = await loadSchemaFromDefaultLocation(rule.schemaPath);
10987
11101
  if (!schema.ok) {
10988
- failures.push({ path: path7, error: schema.error });
11102
+ failures.push({ rule, error: schema.error });
10989
11103
  continue;
10990
11104
  }
11105
+ if (rule.conflictsWith) {
11106
+ const conflictingSchema = await loadSchemaFromDefaultLocation(rule.conflictsWith);
11107
+ if (conflictingSchema.ok) {
11108
+ throw new Error(
11109
+ `Found Prisma Schemas at both \`${import_path2.default.relative(cwd, rule.schemaPath.path)}\` and \`${import_path2.default.relative(
11110
+ cwd,
11111
+ rule.conflictsWith.path
11112
+ )}\`. Please remove one.`
11113
+ );
11114
+ }
11115
+ }
10991
11116
  return schema;
10992
11117
  }
10993
11118
  return {
@@ -10998,6 +11123,14 @@ async function getDefaultSchema(cwd, failures = []) {
10998
11123
  }
10999
11124
  };
11000
11125
  }
11126
+ async function loadSchemaFromDefaultLocation(lookupPath) {
11127
+ switch (lookupPath.kind) {
11128
+ case "file":
11129
+ return readSchemaFromSingleFile(lookupPath.path);
11130
+ case "directory":
11131
+ return readSchemaFromDirectory(lookupPath.path);
11132
+ }
11133
+ }
11001
11134
  var debug3 = (0, import_debug.default)("prisma:migrate:diff");
11002
11135
  var helpOptions = (0, import_internals.format)(
11003
11136
  `${(0, import_chunk_SKRR5WT4.bold)("Usage")}
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_ZJ4IDCRR_exports = {};
30
- __export(chunk_ZJ4IDCRR_exports, {
29
+ var chunk_QJT4H5N6_exports = {};
30
+ __export(chunk_QJT4H5N6_exports, {
31
31
  DbPull: () => DbPull
32
32
  });
33
- module.exports = __toCommonJS(chunk_ZJ4IDCRR_exports);
33
+ module.exports = __toCommonJS(chunk_QJT4H5N6_exports);
34
34
  var import_chunk_IINN7QUV = require("./chunk-IINN7QUV.js");
35
+ var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
35
36
  var import_chunk_RR6BKMNO = require("./chunk-RR6BKMNO.js");
36
37
  var import_chunk_RTGQXNX6 = require("./chunk-RTGQXNX6.js");
37
38
  var import_chunk_AI6DH66U = require("./chunk-AI6DH66U.js");
38
39
  var import_chunk_AHJ2N6BJ = require("./chunk-AHJ2N6BJ.js");
39
- var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
40
40
  var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
41
41
  var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
42
42
  var import_chunk_D2DGSPW6 = require("./chunk-D2DGSPW6.js");