@prisma/migrate 6.4.0-dev.6 → 6.4.0-dev.60

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.
Files changed (68) hide show
  1. package/dist/CLI.js +3 -3
  2. package/dist/Migrate.js +4 -4
  3. package/dist/SchemaEngine.js +4 -4
  4. package/dist/bin.js +61 -47
  5. package/dist/{chunk-HAJNCOW7.js → chunk-26XQQ4AG.js} +25 -23
  6. package/dist/{chunk-I63N54YI.js → chunk-2RSEPJFX.js} +15 -13
  7. package/dist/{chunk-77RYI3ZW.js → chunk-4B2LXK4R.js} +14 -12
  8. package/dist/{chunk-CK5VLKFM.js → chunk-4UJBOCZJ.js} +7 -6
  9. package/dist/{chunk-43RWRQLU.js → chunk-5HZLCY6X.js} +14 -12
  10. package/dist/{chunk-AMRGQNRR.js → chunk-75EIHNAH.js} +6 -6
  11. package/dist/{chunk-Q3SQU7C6.js → chunk-7S3Q4MCN.js} +4 -4
  12. package/dist/{chunk-G66QFMM5.js → chunk-AOX7CJAS.js} +14 -12
  13. package/dist/{chunk-GRGGAY6L.js → chunk-CUDKD32S.js} +159 -5
  14. package/dist/{chunk-CNAS3YE2.js → chunk-DUCG3NRP.js} +76 -42
  15. package/dist/{chunk-JESW2ENL.js → chunk-FF3526PX.js} +14 -12
  16. package/dist/{chunk-JZ6FKTWG.js → chunk-FUSFURVP.js} +6 -6
  17. package/dist/{chunk-CSUAUCRR.js → chunk-GCTCQLOF.js} +15 -13
  18. package/dist/{chunk-7QAR4NT3.js → chunk-K44VNAFW.js} +15 -13
  19. package/dist/{chunk-KZEXQFQA.js → chunk-KK5B5L6X.js} +77 -43
  20. package/dist/{chunk-EYA6AFSF.js → chunk-M5YNQ2NP.js} +5 -5
  21. package/dist/{chunk-NJUAN6V2.js → chunk-O4BT6W33.js} +7 -6
  22. package/dist/{chunk-ZKWJDQMB.js → chunk-UVNSK22K.js} +7 -7
  23. package/dist/{chunk-WJT3IOMB.js → chunk-X6XGFLEF.js} +11 -9
  24. package/dist/{chunk-E2XKFV2C.js → chunk-YD7GG4WS.js} +8 -6
  25. package/dist/{chunk-JTNVQIRB.js → chunk-YWWOSXMY.js} +6 -6
  26. package/dist/commands/DbCommand.js +3 -3
  27. package/dist/commands/DbDrop.js +3 -3
  28. package/dist/commands/DbExecute.js +5 -5
  29. package/dist/commands/DbPull.js +5 -5
  30. package/dist/commands/DbPush.js +6 -6
  31. package/dist/commands/DbSeed.js +3 -3
  32. package/dist/commands/MigrateCommand.js +3 -3
  33. package/dist/commands/MigrateDeploy.js +6 -6
  34. package/dist/commands/MigrateDev.js +6 -6
  35. package/dist/commands/MigrateDiff.js +5 -5
  36. package/dist/commands/MigrateReset.js +6 -6
  37. package/dist/commands/MigrateResolve.js +6 -6
  38. package/dist/commands/MigrateStatus.js +6 -6
  39. package/dist/index.js +54 -54
  40. package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +2 -1
  41. package/dist/internals/src/cli/getSchema.d.ts +20 -37
  42. package/dist/internals/src/cli/hashes.d.ts +2 -1
  43. package/dist/internals/src/cli/types.d.ts +2 -1
  44. package/dist/internals/src/index.d.ts +2 -1
  45. package/dist/internals/src/utils/loadEnvFile.d.ts +4 -2
  46. package/dist/internals/src/utils/toSchemasContainer.d.ts +1 -1
  47. package/dist/migrate/src/CLI.d.ts +2 -1
  48. package/dist/migrate/src/commands/DbCommand.d.ts +2 -1
  49. package/dist/migrate/src/commands/DbDrop.d.ts +2 -1
  50. package/dist/migrate/src/commands/DbExecute.d.ts +2 -1
  51. package/dist/migrate/src/commands/DbPull.d.ts +2 -1
  52. package/dist/migrate/src/commands/DbPush.d.ts +2 -1
  53. package/dist/migrate/src/commands/DbSeed.d.ts +2 -1
  54. package/dist/migrate/src/commands/MigrateCommand.d.ts +2 -1
  55. package/dist/migrate/src/commands/MigrateDeploy.d.ts +2 -1
  56. package/dist/migrate/src/commands/MigrateDev.d.ts +2 -1
  57. package/dist/migrate/src/commands/MigrateDiff.d.ts +2 -1
  58. package/dist/migrate/src/commands/MigrateReset.d.ts +2 -1
  59. package/dist/migrate/src/commands/MigrateResolve.d.ts +2 -1
  60. package/dist/migrate/src/commands/MigrateStatus.d.ts +2 -1
  61. package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +3 -3
  62. package/dist/migrate/src/utils/setupPostgres.d.ts +1 -1
  63. package/dist/utils/getDatabaseVersionSafe.js +4 -4
  64. package/dist/utils/getSchemaPathAndPrint.js +4 -4
  65. package/dist/utils/introspectSql.js +3 -3
  66. package/dist/utils/setupPostgres.js +4 -8
  67. package/dist/utils/spinner.js +3 -3
  68. package/package.json +7 -6
@@ -1,7 +1,8 @@
1
+ import type { PrismaConfigInternal } from '@prisma/config';
1
2
  import { Command, HelpError } from '@prisma/internals';
2
3
  export declare class DbPush implements Command {
3
4
  static new(): DbPush;
4
5
  private static help;
5
- parse(argv: string[]): Promise<string | Error>;
6
+ parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
6
7
  help(error?: string): string | HelpError;
7
8
  }
@@ -1,7 +1,8 @@
1
+ import type { PrismaConfigInternal } from '@prisma/config';
1
2
  import { Command, HelpError } from '@prisma/internals';
2
3
  export declare class DbSeed implements Command {
3
4
  static new(): DbSeed;
4
5
  private static help;
5
- parse(argv: string[]): Promise<string | Error>;
6
+ parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
6
7
  help(error?: string): string | HelpError;
7
8
  }
@@ -1,3 +1,4 @@
1
+ import type { PrismaConfigInternal } from '@prisma/config';
1
2
  import type { Command, Commands } from '@prisma/internals';
2
3
  import { HelpError } from '@prisma/internals';
3
4
  export declare class MigrateCommand implements Command {
@@ -5,6 +6,6 @@ export declare class MigrateCommand implements Command {
5
6
  static new(cmds: Commands): MigrateCommand;
6
7
  private static help;
7
8
  private constructor();
8
- parse(argv: string[]): Promise<string | Error>;
9
+ parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
9
10
  help(error?: string): string | HelpError;
10
11
  }
@@ -1,7 +1,8 @@
1
+ import type { PrismaConfigInternal } from '@prisma/config';
1
2
  import { Command, HelpError } from '@prisma/internals';
2
3
  export declare class MigrateDeploy implements Command {
3
4
  static new(): MigrateDeploy;
4
5
  private static help;
5
- parse(argv: string[]): Promise<string | Error>;
6
+ parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
6
7
  help(error?: string): string | HelpError;
7
8
  }
@@ -1,8 +1,9 @@
1
+ import type { PrismaConfigInternal } from '@prisma/config';
1
2
  import { Command, HelpError } from '@prisma/internals';
2
3
  export declare class MigrateDev implements Command {
3
4
  static new(): MigrateDev;
4
5
  private static help;
5
- parse(argv: string[]): Promise<string | Error>;
6
+ parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
6
7
  private confirmReset;
7
8
  help(error?: string): string | HelpError;
8
9
  }
@@ -1,7 +1,8 @@
1
+ import type { PrismaConfigInternal } from '@prisma/config';
1
2
  import { Command, HelpError } from '@prisma/internals';
2
3
  export declare class MigrateDiff implements Command {
3
4
  static new(): MigrateDiff;
4
5
  private static help;
5
- parse(argv: string[]): Promise<string | Error>;
6
+ parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
6
7
  help(error?: string): string | HelpError;
7
8
  }
@@ -1,7 +1,8 @@
1
+ import type { PrismaConfigInternal } from '@prisma/config';
1
2
  import { Command, HelpError } from '@prisma/internals';
2
3
  export declare class MigrateReset implements Command {
3
4
  static new(): MigrateReset;
4
5
  private static help;
5
- parse(argv: string[]): Promise<string | Error>;
6
+ parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
6
7
  help(error?: string): string | HelpError;
7
8
  }
@@ -1,7 +1,8 @@
1
+ import type { PrismaConfigInternal } from '@prisma/config';
1
2
  import { Command, HelpError } from '@prisma/internals';
2
3
  export declare class MigrateResolve implements Command {
3
4
  static new(): MigrateResolve;
4
5
  private static help;
5
- parse(argv: string[]): Promise<string | Error>;
6
+ parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
6
7
  help(error?: string): string | HelpError;
7
8
  }
@@ -1,7 +1,8 @@
1
+ import type { PrismaConfigInternal } from '@prisma/config';
1
2
  import { Command, HelpError } from '@prisma/internals';
2
3
  export declare class MigrateStatus implements Command {
3
4
  static new(): MigrateStatus;
4
5
  private static help;
5
- parse(argv: string[]): Promise<string | Error>;
6
+ parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
6
7
  help(error?: string): string | HelpError;
7
8
  }
@@ -1,10 +1,10 @@
1
- import { GetSchemaOptions, type GetSchemaResult } from '@prisma/internals';
1
+ import { type GetSchemaOptions, type GetSchemaResult, type SchemaPathFromConfig } from '@prisma/internals';
2
2
  /**
3
3
  * If a path is provided checks that it exists or error
4
4
  * If no path provided check in default location(s) or error
5
- * Schema found: print to console it's relative path
5
+ * Schema found: print to console its relative path
6
6
  *
7
7
  * @returns {GetSchemaResult}
8
8
  */
9
- export declare function getSchemaPathAndPrint(schemaPathProvided?: string, options?: GetSchemaOptions): Promise<GetSchemaResult>;
9
+ export declare function getSchemaPathAndPrint(schemaPathProvided?: string, schemaPathFromConfig?: SchemaPathFromConfig, options?: GetSchemaOptions): Promise<GetSchemaResult>;
10
10
  export declare function printSchemaLoadedMessage(schemaPath: string): void;
@@ -10,4 +10,4 @@ export declare function tearDownPostgres(options: SetupParams): Promise<void>;
10
10
  * This function should be called after `setupPostgres` and before `tearDownPostgres`.
11
11
  * The given `options.connectionString` is used as is.
12
12
  */
13
- export declare function runQueryPostgres(options: SetupParams, query: string): Promise<void>;
13
+ export declare function runQueryPostgres(options: Omit<SetupParams, 'dirname'>, query: string): Promise<void>;
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var getDatabaseVersionSafe_exports = {};
20
20
  __export(getDatabaseVersionSafe_exports, {
21
- getDatabaseVersionSafe: () => import_chunk_JTNVQIRB.getDatabaseVersionSafe
21
+ getDatabaseVersionSafe: () => import_chunk_YWWOSXMY.getDatabaseVersionSafe
22
22
  });
23
23
  module.exports = __toCommonJS(getDatabaseVersionSafe_exports);
24
- var import_chunk_JTNVQIRB = require("../chunk-JTNVQIRB.js");
25
- var import_chunk_Q3SQU7C6 = require("../chunk-Q3SQU7C6.js");
24
+ var import_chunk_YWWOSXMY = require("../chunk-YWWOSXMY.js");
25
+ var import_chunk_7S3Q4MCN = require("../chunk-7S3Q4MCN.js");
26
26
  var import_chunk_CQQQ436N = require("../chunk-CQQQ436N.js");
27
27
  var import_chunk_AAATUOV6 = require("../chunk-AAATUOV6.js");
28
28
  var import_chunk_6TE2RIPN = require("../chunk-6TE2RIPN.js");
29
29
  var import_chunk_WWAWV7DQ = require("../chunk-WWAWV7DQ.js");
30
- (0, import_chunk_JTNVQIRB.init_getDatabaseVersionSafe)();
30
+ (0, import_chunk_YWWOSXMY.init_getDatabaseVersionSafe)();
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var getSchemaPathAndPrint_exports = {};
20
20
  __export(getSchemaPathAndPrint_exports, {
21
- getSchemaPathAndPrint: () => import_chunk_EYA6AFSF.getSchemaPathAndPrint,
22
- printSchemaLoadedMessage: () => import_chunk_EYA6AFSF.printSchemaLoadedMessage
21
+ getSchemaPathAndPrint: () => import_chunk_M5YNQ2NP.getSchemaPathAndPrint,
22
+ printSchemaLoadedMessage: () => import_chunk_M5YNQ2NP.printSchemaLoadedMessage
23
23
  });
24
24
  module.exports = __toCommonJS(getSchemaPathAndPrint_exports);
25
- var import_chunk_EYA6AFSF = require("../chunk-EYA6AFSF.js");
25
+ var import_chunk_M5YNQ2NP = require("../chunk-M5YNQ2NP.js");
26
26
  var import_chunk_6TE2RIPN = require("../chunk-6TE2RIPN.js");
27
27
  var import_chunk_WWAWV7DQ = require("../chunk-WWAWV7DQ.js");
28
- (0, import_chunk_EYA6AFSF.init_getSchemaPathAndPrint)();
28
+ (0, import_chunk_M5YNQ2NP.init_getSchemaPathAndPrint)();
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var introspectSql_exports = {};
20
20
  __export(introspectSql_exports, {
21
- introspectSql: () => import_chunk_AMRGQNRR.introspectSql
21
+ introspectSql: () => import_chunk_75EIHNAH.introspectSql
22
22
  });
23
23
  module.exports = __toCommonJS(introspectSql_exports);
24
- var import_chunk_AMRGQNRR = require("../chunk-AMRGQNRR.js");
25
- var import_chunk_Q3SQU7C6 = require("../chunk-Q3SQU7C6.js");
24
+ var import_chunk_75EIHNAH = require("../chunk-75EIHNAH.js");
25
+ var import_chunk_7S3Q4MCN = require("../chunk-7S3Q4MCN.js");
26
26
  var import_chunk_CQQQ436N = require("../chunk-CQQQ436N.js");
27
27
  var import_chunk_AAATUOV6 = require("../chunk-AAATUOV6.js");
28
28
  var import_chunk_6TE2RIPN = require("../chunk-6TE2RIPN.js");
@@ -35,9 +35,9 @@ __export(setupPostgres_exports, {
35
35
  module.exports = __toCommonJS(setupPostgres_exports);
36
36
  var import_chunk_73OPZA7N = require("../chunk-73OPZA7N.js");
37
37
  var import_chunk_WWAWV7DQ = require("../chunk-WWAWV7DQ.js");
38
+ var import_promises = __toESM(require("node:fs/promises"));
39
+ var import_node_path = __toESM(require("node:path"));
38
40
  var import_internals = require("@prisma/internals");
39
- var import_fs = __toESM(require("fs"));
40
- var import_path = __toESM(require("path"));
41
41
  var import_pg = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_73OPZA7N.require_lib)());
42
42
  async function setupPostgres(options) {
43
43
  const { connectionString } = options;
@@ -53,12 +53,8 @@ async function setupPostgres(options) {
53
53
  await dbDefault.query(`CREATE DATABASE "${credentials.database}";`);
54
54
  await dbDefault.end();
55
55
  if (dirname !== "") {
56
- const db = new import_pg.Client({
57
- connectionString
58
- });
59
- await db.connect();
60
- await db.query(import_fs.default.readFileSync(import_path.default.join(dirname, "setup.sql"), "utf-8"));
61
- await db.end();
56
+ const migrationScript = await import_promises.default.readFile(import_node_path.default.join(dirname, "setup.sql"), { encoding: "utf-8" });
57
+ await runQueryPostgres({ connectionString }, migrationScript);
62
58
  }
63
59
  }
64
60
  async function tearDownPostgres(options) {
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var spinner_exports = {};
20
20
  __export(spinner_exports, {
21
- createSpinner: () => import_chunk_GRGGAY6L.createSpinner
21
+ createSpinner: () => import_chunk_CUDKD32S.createSpinner
22
22
  });
23
23
  module.exports = __toCommonJS(spinner_exports);
24
- var import_chunk_GRGGAY6L = require("../chunk-GRGGAY6L.js");
24
+ var import_chunk_CUDKD32S = require("../chunk-CUDKD32S.js");
25
25
  var import_chunk_YUCPBDWV = require("../chunk-YUCPBDWV.js");
26
26
  var import_chunk_RM5LJIEV = require("../chunk-RM5LJIEV.js");
27
27
  var import_chunk_6C7ESGWY = require("../chunk-6C7ESGWY.js");
28
28
  var import_chunk_J46BJQHT = require("../chunk-J46BJQHT.js");
29
29
  var import_chunk_WWAWV7DQ = require("../chunk-WWAWV7DQ.js");
30
- (0, import_chunk_GRGGAY6L.init_spinner)();
30
+ (0, import_chunk_CUDKD32S.init_spinner)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/migrate",
3
- "version": "6.4.0-dev.6",
3
+ "version": "6.4.0-dev.60",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/migrate/src/index.d.ts",
@@ -55,12 +55,13 @@
55
55
  "@prisma/internals": "*"
56
56
  },
57
57
  "dependencies": {
58
- "@prisma/engines-version": "6.4.0-4.e2a33755136ec1c2b3a5d7d322f86a8fb1205a40",
58
+ "@prisma/engines-version": "6.4.0-29.a9055b89e58b4b5bfb59600785423b1db3d0e75d",
59
59
  "prompts": "2.4.2",
60
- "@prisma/debug": "6.4.0-dev.6",
61
- "@prisma/get-platform": "6.4.0-dev.6",
62
- "@prisma/generator-helper": "6.4.0-dev.6",
63
- "@prisma/internals": "6.4.0-dev.6"
60
+ "@prisma/config": "6.4.0-dev.60",
61
+ "@prisma/generator-helper": "6.4.0-dev.60",
62
+ "@prisma/debug": "6.4.0-dev.60",
63
+ "@prisma/internals": "6.4.0-dev.60",
64
+ "@prisma/get-platform": "6.4.0-dev.60"
64
65
  },
65
66
  "files": [
66
67
  "README.md",