@prisma/orm-toolchain 8.0.0-rc.23-dev.14 → 8.0.0-rc.24-dev.2

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/cli.mjs CHANGED
@@ -43,8 +43,8 @@ import stringWidth from "string-width";
43
43
  import { bold, createColors, cyan, cyanBright, dim, green, yellow } from "colorette";
44
44
  import { isCI } from "ci-info";
45
45
  import { build } from "esbuild";
46
- //#region ../../../1-framework/3-tooling/cli/dist/cli-BvlI6kIO.mjs
47
- var version = "8.0.0-rc.23-dev.14";
46
+ //#region ../../../1-framework/3-tooling/cli/dist/cli-CvSCsXrx.mjs
47
+ var version = "8.0.0-rc.24-dev.2";
48
48
  const ESCAPES = {
49
49
  "\\": "\\\\",
50
50
  " ": "\\t",
@@ -11816,6 +11816,45 @@ const refSetCommand = createRefSetCommand();
11816
11816
  * dotted code.
11817
11817
  */
11818
11818
  const DOCS_BASE_URL = `${DOCS_BASE}/`;
11819
+ const commands = {
11820
+ "contract print": contractPrintCommand,
11821
+ "contract emit": contractEmitCommand,
11822
+ "contract format": formatCommand,
11823
+ "contract infer": contractInferCommand,
11824
+ "db init": dbInitCommand,
11825
+ "db migrate": migrateCommand,
11826
+ "db schema": dbSchemaCommand,
11827
+ "db sign": dbSignCommand,
11828
+ "db update": dbUpdateCommand,
11829
+ "db verify": dbVerifyCommand,
11830
+ lsp: lspCommand,
11831
+ "migration check": migrationCheckCommand,
11832
+ "migration graph": migrationGraphCommand,
11833
+ "migration list": migrationListCommand,
11834
+ "migration log": migrationLogCommand,
11835
+ "migration new": migrationNewCommand,
11836
+ "migration plan": migrationPlanCommand,
11837
+ "migration ref delete": refDeleteCommand,
11838
+ "migration ref list": refListCommand,
11839
+ "migration ref set": refSetCommand,
11840
+ "migration show": migrationShowCommand,
11841
+ "migration status": migrationStatusCommand,
11842
+ "orm init": initCommand
11843
+ };
11844
+ const CLI_DOCS_URL = "https://www.prisma.io/docs/cli";
11845
+ const PRISMA_7_INSTALL = "install its CLI with `npm install --save-dev @prisma/prisma7@7`";
11846
+ function v7Command(from, entry) {
11847
+ const { whileMigrationsStayOnPrisma7, prisma7Invocation, reason, ...rest } = entry;
11848
+ const invocation = `prisma7 ${prisma7Invocation ?? from}`;
11849
+ const prisma7 = whileMigrationsStayOnPrisma7 ? `While Prisma 7 still owns this project's migrations, ${PRISMA_7_INSTALL} and run \`${invocation}\` instead.` : `To keep using Prisma 7, ${PRISMA_7_INSTALL} and run \`${invocation}\`.`;
11850
+ return {
11851
+ from,
11852
+ code: "CLI.V7_COMMAND",
11853
+ summary: `\`{bin} ${from}\` is a Prisma 7 command and is not available in Prisma 8`,
11854
+ reason: `${reason} ${prisma7}`,
11855
+ ...rest
11856
+ };
11857
+ }
11819
11858
  /**
11820
11859
  * The unit the ORM contributes to a CLI: its config section, its commands by
11821
11860
  * name, where its diagnostics are documented, and the invocations it retired.
@@ -11823,31 +11862,7 @@ const DOCS_BASE_URL = `${DOCS_BASE}/`;
11823
11862
  */
11824
11863
  const ormCommandFamily = defineCommandFamily({
11825
11864
  configSection: ormConfigSection,
11826
- commands: {
11827
- "contract print": contractPrintCommand,
11828
- "contract emit": contractEmitCommand,
11829
- "contract format": formatCommand,
11830
- "contract infer": contractInferCommand,
11831
- "db init": dbInitCommand,
11832
- "db migrate": migrateCommand,
11833
- "db schema": dbSchemaCommand,
11834
- "db sign": dbSignCommand,
11835
- "db update": dbUpdateCommand,
11836
- "db verify": dbVerifyCommand,
11837
- lsp: lspCommand,
11838
- "migration check": migrationCheckCommand,
11839
- "migration graph": migrationGraphCommand,
11840
- "migration list": migrationListCommand,
11841
- "migration log": migrationLogCommand,
11842
- "migration new": migrationNewCommand,
11843
- "migration plan": migrationPlanCommand,
11844
- "migration ref delete": refDeleteCommand,
11845
- "migration ref list": refListCommand,
11846
- "migration ref set": refSetCommand,
11847
- "migration show": migrationShowCommand,
11848
- "migration status": migrationStatusCommand,
11849
- "orm init": initCommand
11850
- },
11865
+ commands,
11851
11866
  docsBaseUrl: DOCS_BASE_URL,
11852
11867
  redirects: [
11853
11868
  {
@@ -11879,36 +11894,84 @@ const ormCommandFamily = defineCommandFamily({
11879
11894
  replacement: "{bin} migration status --to <contract>",
11880
11895
  reason: "One flag names the target contract, whether it is a ref, a hash or a migration."
11881
11896
  },
11882
- {
11883
- from: "migrate dev",
11884
- replacement: "{bin} contract emit",
11885
- reason: "Prisma 8 emits the contract, plans the migration and applies it in separate steps: run `contract emit`, then `migration plan --name <name>` (for `--create-only`, stop here), then `db migrate --advance-ref db`; while Prisma 7 still owns this project's migrations, run `migrate dev` with Prisma 7's CLI instead."
11886
- },
11887
- {
11888
- from: "migrate deploy",
11897
+ v7Command("migrate dev", {
11898
+ replacement: [
11899
+ "{bin} contract emit",
11900
+ "{bin} migration plan --name <name>",
11901
+ "{bin} db migrate --advance-ref db"
11902
+ ],
11903
+ reason: "Prisma 8 emits the contract, plans the migration and applies it in separate steps: run `contract emit`, then `migration plan --name <name>` (for `--create-only`, stop here), then `db migrate --advance-ref db`.",
11904
+ whileMigrationsStayOnPrisma7: true,
11905
+ help: "contract emit"
11906
+ }),
11907
+ v7Command("migrate deploy", {
11889
11908
  replacement: "{bin} db migrate",
11890
- reason: "`db migrate` applies the planned migrations; while Prisma 7 still owns this project's migrations, run `migrate deploy` with Prisma 7's CLI instead."
11891
- },
11892
- {
11893
- from: "migrate status",
11909
+ reason: "`db migrate` applies the planned migrations.",
11910
+ whileMigrationsStayOnPrisma7: true,
11911
+ help: "db migrate"
11912
+ }),
11913
+ v7Command("migrate status", {
11894
11914
  replacement: "{bin} migration status",
11895
- reason: "`migration status` reports which planned migrations the database has applied; while Prisma 7 still owns this project's migrations, run `migrate status` with Prisma 7's CLI instead."
11896
- },
11897
- {
11898
- from: "migrate diff",
11915
+ reason: "`migration status` reports which planned migrations the database has applied.",
11916
+ whileMigrationsStayOnPrisma7: true,
11917
+ help: "migration status"
11918
+ }),
11919
+ v7Command("migrate diff", {
11899
11920
  replacement: "{bin} db update --dry-run",
11900
- reason: "`db update --dry-run` prints the changes between the contract and a live database without applying them; to write the changes between two contracts as a migration package use `migration plan`, and to report drift use `db verify`."
11901
- },
11902
- {
11903
- from: "migrate reset",
11921
+ reason: "`db update --dry-run` prints the changes between the contract and a live database without applying them; to write the changes between two contracts as a migration package use `migration plan`, and to report drift use `db verify`.",
11922
+ prisma7Invocation: "migrate diff --from-config-datasource --to-schema <path>",
11923
+ help: "db update"
11924
+ }),
11925
+ v7Command("migrate reset", {
11904
11926
  replacement: "{bin} db update",
11905
- reason: "Prisma 8 has no reset: `db update` moves the database to the contract without a reset and asks before losing data, on a database whose migration history does not need to be kept; a database that changes only through migrations is moved with `db migrate`; while Prisma 7 still owns this project's migrations, run `migrate reset` with Prisma 7's CLI instead."
11906
- },
11907
- {
11908
- from: "migrate resolve",
11927
+ reason: "Prisma 8 has no reset: `db update` moves the database to the contract without a reset and asks before losing data, on a database whose migration history does not need to be kept; a database that changes only through migrations is moved with `db migrate`.",
11928
+ whileMigrationsStayOnPrisma7: true,
11929
+ help: "db update"
11930
+ }),
11931
+ v7Command("migrate resolve", {
11909
11932
  replacement: "{bin} db sign <migration>",
11910
- reason: "`db sign <migration>` checks that the database already has that migration's schema and moves the database marker to that migration's contract, so `db migrate` continues after it; `migration status` does not list the migration as applied. Use it where you would run `migrate resolve --applied` after applying a migration's changes by hand. While Prisma 7 still owns this project's migrations, run `migrate resolve` with Prisma 7's CLI instead."
11911
- }
11933
+ reason: "`db sign <migration>` checks that the database already has that migration's schema and moves the database marker to that migration's contract, so `db migrate` continues after it; `migration status` does not list the migration as applied. Use it where you would run `migrate resolve --applied` after applying a migration's changes by hand.",
11934
+ whileMigrationsStayOnPrisma7: true,
11935
+ prisma7Invocation: "migrate resolve --applied <migration>",
11936
+ help: "db sign"
11937
+ }),
11938
+ v7Command("generate", {
11939
+ replacement: "{bin} contract emit",
11940
+ help: "contract emit",
11941
+ reason: "Prisma 8 has no client generation step. `contract emit` reads your schema and writes contract.json and contract.d.ts, the contract files the ORM reads to know your data model and its types."
11942
+ }),
11943
+ v7Command("validate", {
11944
+ docsUrl: CLI_DOCS_URL,
11945
+ reason: "Prisma 8 has no separate validate command. `contract emit` reports an invalid schema when it runs, and writes the contract files when the schema is valid."
11946
+ }),
11947
+ v7Command("format", {
11948
+ replacement: "{bin} contract format",
11949
+ help: "contract format",
11950
+ reason: "`contract format` formats the PSL schema files your prisma.config.ts names as the contract source, in place. It leaves a schema written in TypeScript untouched."
11951
+ }),
11952
+ v7Command("studio", {
11953
+ docsUrl: CLI_DOCS_URL,
11954
+ reason: "Prisma 8 has no Studio command for browsing and editing your data in a browser."
11955
+ }),
11956
+ v7Command("db pull", {
11957
+ replacement: "{bin} contract infer",
11958
+ help: "contract infer",
11959
+ reason: "`contract infer` reads the live database, named with `--db <url>`, and writes its schema as a PSL contract file. Run `contract emit` afterwards to write the contract files the ORM reads, then `db sign` to record that the database matches the contract, so queries can run against it."
11960
+ }),
11961
+ v7Command("db push", {
11962
+ replacement: "{bin} db update",
11963
+ help: "db update",
11964
+ reason: "`db update` changes the database to match the contract directly, without migration files, and asks before any change that would lose data. On a new database, `db init` creates what the contract declares and never removes or changes anything already there. Both read the contract files `contract emit` writes, so run `contract emit` after changing the schema."
11965
+ }),
11966
+ v7Command("db seed", {
11967
+ docsUrl: CLI_DOCS_URL,
11968
+ reason: "Prisma 8 has no seed command. Run your seed script directly, for example with node."
11969
+ }),
11970
+ v7Command("db execute", {
11971
+ docsUrl: CLI_DOCS_URL,
11972
+ prisma7Invocation: "db execute --file <path>",
11973
+ reason: "Prisma 8 has no command that runs a script file of statements against the database."
11974
+ })
11912
11975
  ]
11913
11976
  });
11914
11977
  /**