From 32690e9f7ccbbc49ddf32c092eba9a382d0e8f04 Mon Sep 17 00:00:00 2001 From: Rich Haines Date: Wed, 11 Aug 2021 11:14:07 +0200 Subject: [PATCH 1/4] Added deprecation warning for prisma introspect command --- .../110-relational-databases/150-introspection.mdx | 7 +++++++ .../100-what-is-prisma/100-data-modeling.mdx | 7 +++++++ .../03-is-prisma-an-orm.mdx | 7 +++++++ .../020-use-custom-model-and-field-names.mdx | 7 +++++++ .../100-components/04-introspection.mdx | 7 +++++++ .../001-sql-server-start-from-scratch.mdx | 14 ++++++++++++++ .../050-add-prisma-migrate-to-a-project.mdx | 7 +++++++ .../200-troubleshooting-development.mdx | 7 +++++++ .../06-cascading-deletes/01-postgresql.mdx | 7 +++++++ .../06-cascading-deletes/02-mysql.mdx | 7 +++++++ .../06-cascading-deletes/03-sqlite.mdx | 7 +++++++ .../07-data-validation/01-postgresql.mdx | 7 +++++++ .../900-advanced-database-tasks/08-sql-views.mdx | 7 +++++++ ...00-managing-env-files-and-setting-variables.mdx | 7 +++++++ .../050-environment-variables/index.mdx | 7 +++++++ .../400-deploying-to-aws-lambda.mdx | 14 ++++++++++++++ .../500-deploying-to-netlify.mdx | 14 ++++++++++++++ .../050-enabling-named-constraints.mdx | 7 +++++++ .../01-how-to-upgrade.mdx | 7 +++++++ .../03-upgrading-the-prisma-layer.mdx | 7 +++++++ .../01-migrate-from-typeorm.mdx | 7 +++++++ .../02-migrate-from-sequelize.mdx | 7 +++++++ .../01-postgresql.mdx | 7 +++++++ .../04-unique-constraints-and-indexes/02-mysql.mdx | 7 +++++++ .../03-sqlite.mdx | 7 +++++++ .../05-foreign-keys/01-postgresql.mdx | 7 +++++++ .../05-foreign-keys/02-mysql.mdx | 7 +++++++ .../05-foreign-keys/03-sqlite.mdx | 7 +++++++ .../100-prisma-schema-reference.mdx | 7 +++++++ .../200-api-reference/200-command-reference.mdx | 7 +++++++ 30 files changed, 231 insertions(+) diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx index 6c07af1689..dc45050d56 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx @@ -143,6 +143,13 @@ Run the following command to introspect your database: npx prisma introspect ``` + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../../reference/api-reference/command-reference#db-pull) command. + +
+ This commands reads the `DATABASE_URL` environment variable that's defined in `.env` and connects to your database. Once the connection is established, it introspects the database (i.e. it _reads the database schema_). It then translates the database schema from SQL into a Prisma data model. After the introspection is complete, your Prisma schema file was updated: diff --git a/content/200-concepts/050-overview/100-what-is-prisma/100-data-modeling.mdx b/content/200-concepts/050-overview/100-what-is-prisma/100-data-modeling.mdx index 9dbfedfa11..376aedbed3 100644 --- a/content/200-concepts/050-overview/100-what-is-prisma/100-data-modeling.mdx +++ b/content/200-concepts/050-overview/100-what-is-prisma/100-data-modeling.mdx @@ -236,6 +236,13 @@ Here is an overview of the main workflow: 1. Run `prisma introspect` to introspect the database and add application models to the Prisma schema 1. Run `prisma generate` to update your Prisma Client API + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ ### Using Prisma Client and Prisma Migrate diff --git a/content/200-concepts/050-overview/300-prisma-in-your-stack/03-is-prisma-an-orm.mdx b/content/200-concepts/050-overview/300-prisma-in-your-stack/03-is-prisma-an-orm.mdx index cee7d7bf33..eabfee2bbe 100644 --- a/content/200-concepts/050-overview/300-prisma-in-your-stack/03-is-prisma-an-orm.mdx +++ b/content/200-concepts/050-overview/300-prisma-in-your-stack/03-is-prisma-an-orm.mdx @@ -314,6 +314,13 @@ generator client { 3. (Optional) Customize [field and model mappings](../../components/prisma-schema/data-model#mapping-model-names-to-tables-or-collections) between Prisma Client and the database. 4. Run `prisma generate`. + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ Prisma will generate Prisma Client inside the `node_modules` folder, from which it can be imported in your application. For more extensive usage documentation, see the [Prisma Client API](../../components/prisma-client) docs. To summarize, Prisma Client can be integrated into projects with an existing database and tooling as part of a parallel adoption strategy. New projects will use a different workflow detailed next. diff --git a/content/200-concepts/100-components/02-prisma-client/000-working-with-prismaclient/020-use-custom-model-and-field-names.mdx b/content/200-concepts/100-components/02-prisma-client/000-working-with-prismaclient/020-use-custom-model-and-field-names.mdx index a15e091782..0cb21fe15e 100644 --- a/content/200-concepts/100-components/02-prisma-client/000-working-with-prismaclient/020-use-custom-model-and-field-names.mdx +++ b/content/200-concepts/100-components/02-prisma-client/000-working-with-prismaclient/020-use-custom-model-and-field-names.mdx @@ -190,6 +190,13 @@ You can "rename" fields and models that are used in the Prisma Client by mapping _After_ you introspected your database with `prisma introspect`, you can manually adjust the resulting Prisma schema as follows: + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ ```prisma model Category { category_id Int @default(autoincrement()) @id diff --git a/content/200-concepts/100-components/04-introspection.mdx b/content/200-concepts/100-components/04-introspection.mdx index 8f98b9933a..0f51f05bb6 100644 --- a/content/200-concepts/100-components/04-introspection.mdx +++ b/content/200-concepts/100-components/04-introspection.mdx @@ -42,6 +42,13 @@ You can learn more about how Prisma maps types from the database to the types av ## The `prisma introspect` command + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ You can introspect your database using the `prisma introspect` command of the [Prisma CLI](prisma-cli/installation). Note that using this command requires your [connection URL](../../reference/database-reference/connection-urls) to be set in your Prisma schema! Here's a high-level overview of the steps that `prisma introspect` performs internally: diff --git a/content/200-concepts/100-components/250-preview-features/100-sql-server/001-sql-server-start-from-scratch.mdx b/content/200-concepts/100-components/250-preview-features/100-sql-server/001-sql-server-start-from-scratch.mdx index faa60bf805..36879664fc 100644 --- a/content/200-concepts/100-components/250-preview-features/100-sql-server/001-sql-server-start-from-scratch.mdx +++ b/content/200-concepts/100-components/250-preview-features/100-sql-server/001-sql-server-start-from-scratch.mdx @@ -168,6 +168,13 @@ To connect to your Microsoft SQL Server database: 1. Introspect your database to validate your connection URL - the CLI will throw a `P4001` error because your database is empty: + + + **Deprecation warning**
+ From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ @@ -351,6 +358,13 @@ To create tables SQL Server Management Studio: ## Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ As a next step, you will introspect your database. The result of the introspection will be a [data model](../../../components/prisma-schema/data-model) inside your Prisma schema. 1. Run the following command to introspect your database: diff --git a/content/300-guides/050-database/100-developing-with-prisma-migrate/050-add-prisma-migrate-to-a-project.mdx b/content/300-guides/050-database/100-developing-with-prisma-migrate/050-add-prisma-migrate-to-a-project.mdx index 5cb374fe81..b8d844f980 100644 --- a/content/300-guides/050-database/100-developing-with-prisma-migrate/050-add-prisma-migrate-to-a-project.mdx +++ b/content/300-guides/050-database/100-developing-with-prisma-migrate/050-add-prisma-migrate-to-a-project.mdx @@ -25,6 +25,13 @@ Production databases and any other database that cannot be reset should be [base ### Introspect to create or update your Prisma schema + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ Make sure your Prisma schema is in sync with your database schema. This should already be true if you are using a previous version of Prisma Migrate. 1. Introspect the database to make sure that your Prisma schema is up-to-date: diff --git a/content/300-guides/050-database/100-developing-with-prisma-migrate/200-troubleshooting-development.mdx b/content/300-guides/050-database/100-developing-with-prisma-migrate/200-troubleshooting-development.mdx index 511912c274..b7d7c5b817 100644 --- a/content/300-guides/050-database/100-developing-with-prisma-migrate/200-troubleshooting-development.mdx +++ b/content/300-guides/050-database/100-developing-with-prisma-migrate/200-troubleshooting-development.mdx @@ -68,6 +68,13 @@ If you made manual changes to the database that you want to keep, you can: 1. Introspect the database: + + + **Deprecation warning**
+ From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ ```terminal npx prisma introspect ``` diff --git a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/01-postgresql.mdx b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/01-postgresql.mdx index 74437d9bc2..cea28f45d3 100644 --- a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/01-postgresql.mdx +++ b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/01-postgresql.mdx @@ -257,6 +257,13 @@ Since `TheLastPost` records can only ever reference existing `TheLastUser` recor ## 7. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ In the previous sections, you created five times two tables with foreign key constraints: - The table `Post` uses `RESTRICT` behavior on the foreign key column `authorId` which points to the `User` table diff --git a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/02-mysql.mdx b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/02-mysql.mdx index 74a1190ab7..0add9027ee 100644 --- a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/02-mysql.mdx +++ b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/02-mysql.mdx @@ -248,6 +248,13 @@ mysql -e 'DROP TABLE `CascadingDeletesDemo`.`TheLastUser`;' ## 6. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ In the previous sections, you created two tables with foreign key constraints for each of the following three scenarios: - The table `Post` uses `RESTRICT` action on the foreign key column `authorId` which points to the `User` table. This is identical to the default behavior and the `NO ACTION` behavior. diff --git a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/03-sqlite.mdx b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/03-sqlite.mdx index 0f7d224a8f..2771edf661 100644 --- a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/03-sqlite.mdx +++ b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/03-sqlite.mdx @@ -257,6 +257,13 @@ Since `TheLastPost` records can only ever reference existing `TheLastUser` recor ## 7. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ In the previous sections, you created five times two tables with foreign key constraints: - The table `Post` uses `RESTRICT` action on the foreign key column `authorId` which points to the `User` table diff --git a/content/300-guides/050-database/900-advanced-database-tasks/07-data-validation/01-postgresql.mdx b/content/300-guides/050-database/900-advanced-database-tasks/07-data-validation/01-postgresql.mdx index 8d2266d799..66ed68e009 100644 --- a/content/300-guides/050-database/900-advanced-database-tasks/07-data-validation/01-postgresql.mdx +++ b/content/300-guides/050-database/900-advanced-database-tasks/07-data-validation/01-postgresql.mdx @@ -234,6 +234,13 @@ Congratulations, you just created a table called `lastproduct` in the database w ## 6. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ In the previous sections, you created four tables with different check constraints: - The `product` table has a check constraint that ensures that the value of `price` is never less than `0.01` and enver exactly `1240.00`. diff --git a/content/300-guides/050-database/900-advanced-database-tasks/08-sql-views.mdx b/content/300-guides/050-database/900-advanced-database-tasks/08-sql-views.mdx index a8f8a4bf76..a9db22a990 100644 --- a/content/300-guides/050-database/900-advanced-database-tasks/08-sql-views.mdx +++ b/content/300-guides/050-database/900-advanced-database-tasks/08-sql-views.mdx @@ -310,6 +310,13 @@ In this section you will create a view named `Draft`. The `Draft` view represent ## 4. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ In this section you'll introspect your database to generate the Prisma models for the tables that you created. > **Note**: You will manually add the `Draft` view to the Prisma schema in a later step. diff --git a/content/300-guides/125-development-environment/050-environment-variables/100-managing-env-files-and-setting-variables.mdx b/content/300-guides/125-development-environment/050-environment-variables/100-managing-env-files-and-setting-variables.mdx index 351deef507..c38631ee9f 100644 --- a/content/300-guides/125-development-environment/050-environment-variables/100-managing-env-files-and-setting-variables.mdx +++ b/content/300-guides/125-development-environment/050-environment-variables/100-managing-env-files-and-setting-variables.mdx @@ -128,6 +128,13 @@ The following steps show how to use the `dotenv-cli` package to use an alternati dotenv -e .env3 -- npx prisma introspect ``` + + + **Deprecation warning**
+ From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ > **Note:** dotenv doesn't pass the flags to the Prisma command by default, this is why the command includes two dashes `--` before `prisma`, making it possible to use flags like `--force`, `--schema` or `--preview-feature`. ### Using dotenv via application code diff --git a/content/300-guides/125-development-environment/050-environment-variables/index.mdx b/content/300-guides/125-development-environment/050-environment-variables/index.mdx index c9832729e6..ed7c49e32f 100644 --- a/content/300-guides/125-development-environment/050-environment-variables/index.mdx +++ b/content/300-guides/125-development-environment/050-environment-variables/index.mdx @@ -106,6 +106,13 @@ DATABASE_URL=postgresql://test:test@localhost:5432/test?schema=public When you run a command that needs access to the database defined via the `datasource` block (for example, `prisma introspect`), the Prisma CLI automatically loads the `DATABASE_URL` environment variables from the `.env` file and makes it available to the CLI. + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ ### Using environment variables in your code If you want environment variables to be evaluated at runtime, you need to load them manually in your application code (for example, by using [`dotenv`](https://github.com/motdotla/dotenv)): diff --git a/content/300-guides/200-deployment/110-deployment-guides/400-deploying-to-aws-lambda.mdx b/content/300-guides/200-deployment/110-deployment-guides/400-deploying-to-aws-lambda.mdx index 4f8f9540dd..f48a9c6a20 100644 --- a/content/300-guides/200-deployment/110-deployment-guides/400-deploying-to-aws-lambda.mdx +++ b/content/300-guides/200-deployment/110-deployment-guides/400-deploying-to-aws-lambda.mdx @@ -53,6 +53,13 @@ This guide starts with an empty database created with plain SQL and looks as fol 1. Run `prisma introspect` locally which will introspect and populate the `schema.prisma` with models based on the database schema. 1. Run `prisma generate` which will generate Prisma Client based on the Prisma schema. + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ ## 1. Download the example Open your terminal and navigate to a location of your choice. Create the directory that will hold the application code and download the example code: @@ -143,6 +150,13 @@ Congratulations, you have successfully created the database schema. ## 5. Introspect the database + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ Introspect the database with the Prisma CLI: ```terminal diff --git a/content/300-guides/200-deployment/110-deployment-guides/500-deploying-to-netlify.mdx b/content/300-guides/200-deployment/110-deployment-guides/500-deploying-to-netlify.mdx index e396a5723c..ad62351812 100644 --- a/content/300-guides/200-deployment/110-deployment-guides/500-deploying-to-netlify.mdx +++ b/content/300-guides/200-deployment/110-deployment-guides/500-deploying-to-netlify.mdx @@ -46,6 +46,13 @@ This guide starts with an empty database created with plain SQL and looks as fol 1. Run `prisma introspect` locally which will introspect and populate the `schema.prisma` with models based on the database schema. 1. Run `prisma generate` which will generate Prisma Client based on the Prisma schema. + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ ## 1. Fork the `deployment-example-netlify` repository Go to [`deployment-example-netlify`](https://github.com/prisma/deployment-example-netlify) and **Fork** the repository by clicking on the fork button on the top right corner: @@ -124,6 +131,13 @@ Congratulations, you have successfully created the database schema. ## 5. Introspect the database + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ Introspect the database with the Prisma CLI: ```terminal diff --git a/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx b/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx index a26367af30..b6238dce12 100644 --- a/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx +++ b/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx @@ -26,6 +26,13 @@ If you started a development environment based on an initial introspection of a ## Upgrade path for introspection only users + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ Use the following guide if you use introspection only. 1. Enable the `namedConstraints` Preview: diff --git a/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/01-how-to-upgrade.mdx b/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/01-how-to-upgrade.mdx index 7c2ec56af5..7515814777 100644 --- a/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/01-how-to-upgrade.mdx +++ b/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/01-how-to-upgrade.mdx @@ -90,6 +90,13 @@ For the **initial setup**: 1. You set up Prisma 2 by installing the Prisma 2 CLI and running `npx prisma init`. 1. You connect to your database and introspect it with `npx prisma introspect`. + + + **Deprecation warning**
+ From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ ![Prisma CLI introspection flow](https://imgur.com/UiJCG4L.png) For **fixing the schema incompatibilities**: diff --git a/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx b/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx index fd4ca3f7e5..f404cda309 100644 --- a/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx +++ b/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx @@ -1060,6 +1060,13 @@ In this section, you'll update your Prisma schema with another introspection rou npx prisma introspect ``` + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. + +
+ This time, the resulting Prisma schema looks as follows: ```prisma file=schema.prisma diff --git a/content/300-guides/400-migrate-to-prisma/01-migrate-from-typeorm.mdx b/content/300-guides/400-migrate-to-prisma/01-migrate-from-typeorm.mdx index 0bc7c7b2c7..3bfc0e4337 100644 --- a/content/300-guides/400-migrate-to-prisma/01-migrate-from-typeorm.mdx +++ b/content/300-guides/400-migrate-to-prisma/01-migrate-from-typeorm.mdx @@ -247,6 +247,13 @@ npm install prisma --save-dev ## Step 2. Introspect your database + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../reference/api-reference/command-reference#db-pull) command. + +
+ ### 2.1. Set up Prisma Before you can introspect your database, you need to set up your [Prisma schema](../../concepts/components/prisma-schema) and connect Prisma to your database. Run the following command in your terminal to create a basic Prisma schema file: diff --git a/content/300-guides/400-migrate-to-prisma/02-migrate-from-sequelize.mdx b/content/300-guides/400-migrate-to-prisma/02-migrate-from-sequelize.mdx index e165d64ca4..bc759823a6 100644 --- a/content/300-guides/400-migrate-to-prisma/02-migrate-from-sequelize.mdx +++ b/content/300-guides/400-migrate-to-prisma/02-migrate-from-sequelize.mdx @@ -179,6 +179,13 @@ npm install prisma --save-dev ## Step 2. Introspect your database + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../reference/api-reference/command-reference#db-pull) command. + +
+ ### 2.1. Set up Prisma Before you can introspect your database, you need to set up your [Prisma schema](../../concepts/components/prisma-schema) and connect Prisma to your database. Run the following command in your terminal to create a basic Prisma schema file: diff --git a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/01-postgresql.mdx b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/01-postgresql.mdx index f21393c6b7..2f062c0c7b 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/01-postgresql.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/01-postgresql.mdx @@ -175,6 +175,13 @@ CREATE UNIQUE INDEX "TheLastUser_firstName_lastName_unique_constraint" ON "TheLa ## 6. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ In the previous sections, you created four tables with unique constraints: - The table `User` has a singe-column unique constraint and index on the `email` column diff --git a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/02-mysql.mdx b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/02-mysql.mdx index 9dcd53dd7a..ce0520b154 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/02-mysql.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/02-mysql.mdx @@ -192,6 +192,13 @@ CREATE UNIQUE INDEX `TheLastUser_firstName_lastName_unique_constraint` ON `Uniqu ## 6. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ In the previous sections, you created four tables with unique constraints: - The table `User` has a singe-column unique constraint and index on the `email` column diff --git a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/03-sqlite.mdx b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/03-sqlite.mdx index 87fe358f69..d63d4c7d4d 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/03-sqlite.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/03-sqlite.mdx @@ -115,6 +115,13 @@ CREATE UNIQUE INDEX "sqlite_autoindex_AnotherUser_1" ON "AnotherUser"("firstName ## 4. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ In the previous sections, you created two tables with unique constraints: - The table `User` has a singe-column unique constraint and index on the `email` column diff --git a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/01-postgresql.mdx b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/01-postgresql.mdx index 5a52cc37c6..42224f5da2 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/01-postgresql.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/01-postgresql.mdx @@ -124,6 +124,13 @@ Congratulations, you just created two tables called `AnotherUser` and `AnotherPo ## 4. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ In the previous sections, you created two different foreign key constraints using four total tables: - The table `Post` has a singe-column foreign key on it's `authorId` column which points to the `id` field of the `User` table. diff --git a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/02-mysql.mdx b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/02-mysql.mdx index 832a2d48fe..5b4ec07729 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/02-mysql.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/02-mysql.mdx @@ -106,6 +106,13 @@ Congratulations, you just created two tables called `AnotherUser` and `AnotherPo ## 4. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ In the previous sections, you created two different foreign key constraints using four total tables: - The table `Post` has a singe-column foreign key on it's `authorId` column which points to the `id` field of the `User` table. diff --git a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/03-sqlite.mdx b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/03-sqlite.mdx index 4d5bd91d19..67aa7e503f 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/03-sqlite.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/03-sqlite.mdx @@ -120,6 +120,13 @@ Congratulations, you just created two tables called `AnotherUser` and `AnotherPo ## 4. Introspect your database with Prisma + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. + +
+ In the previous sections, you created two times two tables with foreign key constraints: - The table `Post` has a singe-column foreign key on it's `authorId` column which points to the `id` field of the `User` table. diff --git a/content/400-reference/200-api-reference/100-prisma-schema-reference.mdx b/content/400-reference/200-api-reference/100-prisma-schema-reference.mdx index c768cf1e3d..4c06d887c3 100644 --- a/content/400-reference/200-api-reference/100-prisma-schema-reference.mdx +++ b/content/400-reference/200-api-reference/100-prisma-schema-reference.mdx @@ -875,6 +875,13 @@ The [MongoDB connector](../../concepts/database-connectors/mongodb) does not cur The `Unsupported` type was introduced in [2.17.0](https://github.com/prisma/prisma/releases/tag/2.17.0) and allows you to represent data types in the Prisma schema that are not supported by the Prisma Client. `Unsupported` fields can be introspected with `prisma introspect` or created with Prisma Migrate or `db push`. + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](./command-reference#db-pull) command. + +
+ #### Remarks - Fields with `Unsupported` types are not available in the generated client. diff --git a/content/400-reference/200-api-reference/200-command-reference.mdx b/content/400-reference/200-api-reference/200-command-reference.mdx index 3b713a02f7..fdb0d5ad09 100644 --- a/content/400-reference/200-api-reference/200-command-reference.mdx +++ b/content/400-reference/200-api-reference/200-command-reference.mdx @@ -420,6 +420,13 @@ datasource db { ##### Analyze the database and write its schema to the `schema.prisma` file + + +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](#db-pull) command. + +
+ From 21b050c3ea821d6f0aefc012d0452743a79384ec Mon Sep 17 00:00:00 2001 From: Rich Haines Date: Wed, 11 Aug 2021 14:27:02 +0200 Subject: [PATCH 2/4] Removed alot of the warnings and changed the command instead --- .../150-introspection.mdx | 9 +------- .../100-what-is-prisma/100-data-modeling.mdx | 9 +------- .../03-is-prisma-an-orm.mdx | 9 +------- .../100-components/01-prisma-schema/index.mdx | 2 +- .../020-use-custom-model-and-field-names.mdx | 9 +------- .../100-components/04-introspection.mdx | 16 +++++++------- .../001-sql-server-start-from-scratch.mdx | 18 ++-------------- .../050-add-prisma-migrate-to-a-project.mdx | 9 +------- .../200-troubleshooting-development.mdx | 9 +------- .../06-cascading-deletes/01-postgresql.mdx | 9 +------- .../06-cascading-deletes/02-mysql.mdx | 9 +------- .../06-cascading-deletes/03-sqlite.mdx | 9 +------- .../07-data-validation/01-postgresql.mdx | 9 +------- .../08-sql-views.mdx | 9 +------- ...naging-env-files-and-setting-variables.mdx | 9 +------- .../050-environment-variables/index.mdx | 11 ++-------- .../400-deploying-to-aws-lambda.mdx | 18 ++-------------- .../500-deploying-to-netlify.mdx | 20 +++--------------- .../050-enabling-named-constraints.mdx | 9 +------- .../01-how-to-upgrade.mdx | 11 ++-------- .../03-upgrading-the-prisma-layer.mdx | 17 +++++---------- .../01-migrate-from-typeorm.mdx | 9 +------- .../02-migrate-from-sequelize.mdx | 9 +------- .../01-postgresql.mdx | 9 +------- .../02-mysql.mdx | 9 +------- .../03-sqlite.mdx | 9 +------- .../05-foreign-keys/01-postgresql.mdx | 9 +------- .../05-foreign-keys/02-mysql.mdx | 9 +------- .../05-foreign-keys/03-sqlite.mdx | 9 +------- .../100-prisma-schema-reference.mdx | 9 +------- .../200-command-reference.mdx | 12 ++++------- src/components/customMdx/admonition.tsx | 21 ++++++++++++++++++- 32 files changed, 71 insertions(+), 273 deletions(-) diff --git a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx index dc45050d56..6da336000e 100644 --- a/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx +++ b/content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/150-introspection.mdx @@ -140,16 +140,9 @@ As a next step, you will introspect your database. The result of the introspecti Run the following command to introspect your database: ```terminal copy -npx prisma introspect +npx prisma db pull ``` - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../../reference/api-reference/command-reference#db-pull) command. - -
- This commands reads the `DATABASE_URL` environment variable that's defined in `.env` and connects to your database. Once the connection is established, it introspects the database (i.e. it _reads the database schema_). It then translates the database schema from SQL into a Prisma data model. After the introspection is complete, your Prisma schema file was updated: diff --git a/content/200-concepts/050-overview/100-what-is-prisma/100-data-modeling.mdx b/content/200-concepts/050-overview/100-what-is-prisma/100-data-modeling.mdx index 376aedbed3..48f8da3a7c 100644 --- a/content/200-concepts/050-overview/100-what-is-prisma/100-data-modeling.mdx +++ b/content/200-concepts/050-overview/100-what-is-prisma/100-data-modeling.mdx @@ -233,16 +233,9 @@ When using only Prisma Client and _not_ using Prisma Migrate in your application Here is an overview of the main workflow: 1. Change your database schema using SQL (e.g. `CREATE TABLE`, `ALTER TABLE`, ...) -1. Run `prisma introspect` to introspect the database and add application models to the Prisma schema +1. Run `prisma db pull` to introspect the database and add application models to the Prisma schema 1. Run `prisma generate` to update your Prisma Client API - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- ### Using Prisma Client and Prisma Migrate diff --git a/content/200-concepts/050-overview/300-prisma-in-your-stack/03-is-prisma-an-orm.mdx b/content/200-concepts/050-overview/300-prisma-in-your-stack/03-is-prisma-an-orm.mdx index eabfee2bbe..ee8040aa2d 100644 --- a/content/200-concepts/050-overview/300-prisma-in-your-stack/03-is-prisma-an-orm.mdx +++ b/content/200-concepts/050-overview/300-prisma-in-your-stack/03-is-prisma-an-orm.mdx @@ -310,17 +310,10 @@ generator client { } ``` -2. Run `prisma introspect` to populate the Prisma schema with models derived from your database schema. +2. Run `prisma db pull` to populate the Prisma schema with models derived from your database schema. 3. (Optional) Customize [field and model mappings](../../components/prisma-schema/data-model#mapping-model-names-to-tables-or-collections) between Prisma Client and the database. 4. Run `prisma generate`. - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- Prisma will generate Prisma Client inside the `node_modules` folder, from which it can be imported in your application. For more extensive usage documentation, see the [Prisma Client API](../../components/prisma-client) docs. To summarize, Prisma Client can be integrated into projects with an existing database and tooling as part of a parallel adoption strategy. New projects will use a different workflow detailed next. diff --git a/content/200-concepts/100-components/01-prisma-schema/index.mdx b/content/200-concepts/100-components/01-prisma-schema/index.mdx index e767205ede..aa32de1a9b 100644 --- a/content/200-concepts/100-components/01-prisma-schema/index.mdx +++ b/content/200-concepts/100-components/01-prisma-schema/index.mdx @@ -168,7 +168,7 @@ The Prisma CLI looks for the Prisma schema file in the following locations, in t - `./prisma/schema.prisma` - `./schema.prisma` -The Prisma CLI outputs the path of the schema file that will be used. The following example shows the terminal output for `prisma introspect`: +The Prisma CLI outputs the path of the schema file that will be used. The following example shows the terminal output for `prisma db pull`: ```no-lines Environment variables loaded from prisma/.env diff --git a/content/200-concepts/100-components/02-prisma-client/000-working-with-prismaclient/020-use-custom-model-and-field-names.mdx b/content/200-concepts/100-components/02-prisma-client/000-working-with-prismaclient/020-use-custom-model-and-field-names.mdx index 0cb21fe15e..ca4ee65ef9 100644 --- a/content/200-concepts/100-components/02-prisma-client/000-working-with-prismaclient/020-use-custom-model-and-field-names.mdx +++ b/content/200-concepts/100-components/02-prisma-client/000-working-with-prismaclient/020-use-custom-model-and-field-names.mdx @@ -188,14 +188,7 @@ In both cases, `user_id` is used to refer to an _entire_ "user object", not only You can "rename" fields and models that are used in the Prisma Client by mapping them to the "original" names in the database using the `@map` and `@@map` attributes. For the [example](#example) above, you could e.g. annotate your models as follows to prevent the mentioned issues. -_After_ you introspected your database with `prisma introspect`, you can manually adjust the resulting Prisma schema as follows: - - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
+_After_ you introspected your database with `prisma db pull`, you can manually adjust the resulting Prisma schema as follows: ```prisma model Category { diff --git a/content/200-concepts/100-components/04-introspection.mdx b/content/200-concepts/100-components/04-introspection.mdx index 0f51f05bb6..efe1441f9e 100644 --- a/content/200-concepts/100-components/04-introspection.mdx +++ b/content/200-concepts/100-components/04-introspection.mdx @@ -45,13 +45,13 @@ You can learn more about how Prisma maps types from the database to the types av **Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. +From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. The following will use the `prisma db pull` command.
-You can introspect your database using the `prisma introspect` command of the [Prisma CLI](prisma-cli/installation). Note that using this command requires your [connection URL](../../reference/database-reference/connection-urls) to be set in your Prisma schema! +You can introspect your database using the `prisma db pull` command of the [Prisma CLI](prisma-cli/installation). Note that using this command requires your [connection URL](../../reference/database-reference/connection-urls) to be set in your Prisma schema! -Here's a high-level overview of the steps that `prisma introspect` performs internally: +Here's a high-level overview of the steps that `prisma db pull` performs internally: 1. Read the [connection URL](../../reference/database-reference/connection-urls) from the `datasource` configuration in the Prisma schema 1. Open database connection @@ -61,7 +61,7 @@ Here's a high-level overview of the steps that `prisma introspect` performs inte ## Introspection with an existing schema -In version 2.6.0 and later, running `prisma introspect` with an existing schema merges manual changes made to the schema with changes made in the database. Introspection maintains the following manual changes: +In version 2.6.0 and later, running `prisma db pull` with an existing schema merges manual changes made to the schema with changes made in the database. Introspection maintains the following manual changes: - Order of `model` blocks - Order of `enum` blocks @@ -83,10 +83,10 @@ The following properties of the schema are determined by the database: ### Force overwrite -To overwrite manual changes, generate a schema based solely on the introspected database and ignore any existing schema file, add the `--force` flag to the `introspect` command: +To overwrite manual changes, generate a schema based solely on the introspected database and ignore any existing schema file, add the `--force` flag to the `db pull` command: ```terminal -npx prisma introspect --force +npx prisma db pull --force ``` Use cases include: @@ -99,7 +99,7 @@ Use cases include: The typical workflow for projects that are not using Prisma Migrate, but instead use plain SQL or another migration tool looks as follows: 1. Change the database schema (e.g. using plain SQL) -1. Run `prisma introspect` to update the Prisma schema +1. Run `prisma db pull` to update the Prisma schema 1. Run `prisma generate` to update Prisma Client 1. Use the updated Prisma Client in your application @@ -325,4 +325,4 @@ Introspecting only a subset of your database schema is [not yet officially suppo However, you can achieve this by creating a new database user that only has access to the tables which you'd like to see represented in your Prisma schema, and then perform the introspection using that user. The introspection will then only include the tables the new user has access to. -If your goal is to exclude certain models from the [Prisma Client generation](prisma-client/working-with-prismaclient/generating-prisma-client), you can also manually delete the models that should be excluded from your Prisma schema. Note however that they will be added again when you run `prisma introspect`. +If your goal is to exclude certain models from the [Prisma Client generation](prisma-client/working-with-prismaclient/generating-prisma-client), you can also manually delete the models that should be excluded from your Prisma schema. Note however that they will be added again when you run `prisma db pull`. diff --git a/content/200-concepts/100-components/250-preview-features/100-sql-server/001-sql-server-start-from-scratch.mdx b/content/200-concepts/100-components/250-preview-features/100-sql-server/001-sql-server-start-from-scratch.mdx index 36879664fc..88c5098487 100644 --- a/content/200-concepts/100-components/250-preview-features/100-sql-server/001-sql-server-start-from-scratch.mdx +++ b/content/200-concepts/100-components/250-preview-features/100-sql-server/001-sql-server-start-from-scratch.mdx @@ -168,19 +168,12 @@ To connect to your Microsoft SQL Server database: 1. Introspect your database to validate your connection URL - the CLI will throw a `P4001` error because your database is empty: - - - **Deprecation warning**
- From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- ```terminal - npx prisma introspect + npx prisma db pull ``` @@ -358,19 +351,12 @@ To create tables SQL Server Management Studio: ## Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- As a next step, you will introspect your database. The result of the introspection will be a [data model](../../../components/prisma-schema/data-model) inside your Prisma schema. 1. Run the following command to introspect your database: ```terminal copy - npx prisma introspect + npx prisma db pull ``` 2. Open `prisma.schema` to see your data model: diff --git a/content/300-guides/050-database/100-developing-with-prisma-migrate/050-add-prisma-migrate-to-a-project.mdx b/content/300-guides/050-database/100-developing-with-prisma-migrate/050-add-prisma-migrate-to-a-project.mdx index b8d844f980..01ab632ad0 100644 --- a/content/300-guides/050-database/100-developing-with-prisma-migrate/050-add-prisma-migrate-to-a-project.mdx +++ b/content/300-guides/050-database/100-developing-with-prisma-migrate/050-add-prisma-migrate-to-a-project.mdx @@ -25,19 +25,12 @@ Production databases and any other database that cannot be reset should be [base ### Introspect to create or update your Prisma schema - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- Make sure your Prisma schema is in sync with your database schema. This should already be true if you are using a previous version of Prisma Migrate. 1. Introspect the database to make sure that your Prisma schema is up-to-date: ```terminal - prisma introspect + prisma db pull ``` ### Initialize migration history diff --git a/content/300-guides/050-database/100-developing-with-prisma-migrate/200-troubleshooting-development.mdx b/content/300-guides/050-database/100-developing-with-prisma-migrate/200-troubleshooting-development.mdx index b7d7c5b817..cff2cbccb8 100644 --- a/content/300-guides/050-database/100-developing-with-prisma-migrate/200-troubleshooting-development.mdx +++ b/content/300-guides/050-database/100-developing-with-prisma-migrate/200-troubleshooting-development.mdx @@ -68,15 +68,8 @@ If you made manual changes to the database that you want to keep, you can: 1. Introspect the database: - - - **Deprecation warning**
- From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- ```terminal - npx prisma introspect + npx prisma db pull ``` Prisma will update your schema with the changes made directly in the database. diff --git a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/01-postgresql.mdx b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/01-postgresql.mdx index cea28f45d3..6b654898a6 100644 --- a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/01-postgresql.mdx +++ b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/01-postgresql.mdx @@ -257,13 +257,6 @@ Since `TheLastPost` records can only ever reference existing `TheLastUser` recor ## 7. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- In the previous sections, you created five times two tables with foreign key constraints: - The table `Post` uses `RESTRICT` behavior on the foreign key column `authorId` which points to the `User` table @@ -309,7 +302,7 @@ DATABASE_URL=postgresql://janedoe:mypassword@localhost:5432/CascadingDeletesDemo With both the `schema.prisma` and `.env` files in place, you can run Prisma's introspection with the following command: ``` -npx prisma introspect +npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/02-mysql.mdx b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/02-mysql.mdx index 0add9027ee..7c8c873bee 100644 --- a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/02-mysql.mdx +++ b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/02-mysql.mdx @@ -248,13 +248,6 @@ mysql -e 'DROP TABLE `CascadingDeletesDemo`.`TheLastUser`;' ## 6. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- In the previous sections, you created two tables with foreign key constraints for each of the following three scenarios: - The table `Post` uses `RESTRICT` action on the foreign key column `authorId` which points to the `User` table. This is identical to the default behavior and the `NO ACTION` behavior. @@ -302,7 +295,7 @@ DATABASE_URL=mysql://janedoe:mypassword@localhost:3306/CascadingDeletesDemo With both the `schema.prisma` and `.env` files in place, you can run Prisma's introspection with the following command: ``` -npx prisma introspect +npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/03-sqlite.mdx b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/03-sqlite.mdx index 2771edf661..5ad450b223 100644 --- a/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/03-sqlite.mdx +++ b/content/300-guides/050-database/900-advanced-database-tasks/06-cascading-deletes/03-sqlite.mdx @@ -257,13 +257,6 @@ Since `TheLastPost` records can only ever reference existing `TheLastUser` recor ## 7. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- In the previous sections, you created five times two tables with foreign key constraints: - The table `Post` uses `RESTRICT` action on the foreign key column `authorId` which points to the `User` table @@ -303,7 +296,7 @@ DATABASE_URL=file:CascadingDeletesDemo.db With both the `schema.prisma` and `.env` files in place, you can run Prisma's introspection with the following command: ``` -npx prisma introspect +npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/300-guides/050-database/900-advanced-database-tasks/07-data-validation/01-postgresql.mdx b/content/300-guides/050-database/900-advanced-database-tasks/07-data-validation/01-postgresql.mdx index 66ed68e009..7718881149 100644 --- a/content/300-guides/050-database/900-advanced-database-tasks/07-data-validation/01-postgresql.mdx +++ b/content/300-guides/050-database/900-advanced-database-tasks/07-data-validation/01-postgresql.mdx @@ -234,13 +234,6 @@ Congratulations, you just created a table called `lastproduct` in the database w ## 6. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- In the previous sections, you created four tables with different check constraints: - The `product` table has a check constraint that ensures that the value of `price` is never less than `0.01` and enver exactly `1240.00`. @@ -287,7 +280,7 @@ DATABASE_URL=postgresql://janedoe:mypassword@localhost:5432/CheckDemo With both the `schema.prisma` and `.env` files in place, you can run Prisma's introspection with the following command: ``` -npx prisma introspect +npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/300-guides/050-database/900-advanced-database-tasks/08-sql-views.mdx b/content/300-guides/050-database/900-advanced-database-tasks/08-sql-views.mdx index a9db22a990..5d2a16ad85 100644 --- a/content/300-guides/050-database/900-advanced-database-tasks/08-sql-views.mdx +++ b/content/300-guides/050-database/900-advanced-database-tasks/08-sql-views.mdx @@ -310,13 +310,6 @@ In this section you will create a view named `Draft`. The `Draft` view represent ## 4. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- In this section you'll introspect your database to generate the Prisma models for the tables that you created. > **Note**: You will manually add the `Draft` view to the Prisma schema in a later step. @@ -393,7 +386,7 @@ In this section you'll introspect your database to generate the Prisma models fo 4. With both the `schema.prisma` and `.env` files in place, run Prisma's introspection with the following command: ```terminal - npx prisma introspect + npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/300-guides/125-development-environment/050-environment-variables/100-managing-env-files-and-setting-variables.mdx b/content/300-guides/125-development-environment/050-environment-variables/100-managing-env-files-and-setting-variables.mdx index c38631ee9f..5701fdb40a 100644 --- a/content/300-guides/125-development-environment/050-environment-variables/100-managing-env-files-and-setting-variables.mdx +++ b/content/300-guides/125-development-environment/050-environment-variables/100-managing-env-files-and-setting-variables.mdx @@ -125,16 +125,9 @@ The following steps show how to use the `dotenv-cli` package to use an alternati 3. To use the `.env3` file, you can use `dotenv` when you run any Prisma command and specify which `.env` file to use. The following example uses a file named `.env3`: ``` - dotenv -e .env3 -- npx prisma introspect + dotenv -e .env3 -- npx prisma db pull ``` - - - **Deprecation warning**
- From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- > **Note:** dotenv doesn't pass the flags to the Prisma command by default, this is why the command includes two dashes `--` before `prisma`, making it possible to use flags like `--force`, `--schema` or `--preview-feature`. ### Using dotenv via application code diff --git a/content/300-guides/125-development-environment/050-environment-variables/index.mdx b/content/300-guides/125-development-environment/050-environment-variables/index.mdx index ed7c49e32f..7b85cbda38 100644 --- a/content/300-guides/125-development-environment/050-environment-variables/index.mdx +++ b/content/300-guides/125-development-environment/050-environment-variables/index.mdx @@ -63,7 +63,7 @@ The following table describes where the Prisma CLI looks for the `.env` file: | `prisma [command]` | `./prisma/schema.prisma` | `./.env`
`./prisma/.env` | | `prisma [command] --schema=./a/b/schema.prisma` | `./a/b/schema.prisma` | `./.env`
`./a/b/.env`
`./prisma/.env` | | `prisma [command]` | `"prisma": {"schema": "/path/to/schema.prisma"}` | `.env`
`./path/to/schema/.env`
`./prisma/.env` | -| `prisma [command]` | No schema (for example, when running `prisma introspect` in an empty directory) | `./.env`
`./prisma/.env` | +| `prisma [command]` | No schema (for example, when running `prisma db pull` in an empty directory) | `./.env`
`./prisma/.env` | Any environment variables defined in that `.env` file will automatically be loaded when running a Prisma CLI command. @@ -104,14 +104,7 @@ You can set the `DATABASE_URL` in your `.env` file: DATABASE_URL=postgresql://test:test@localhost:5432/test?schema=public ``` -When you run a command that needs access to the database defined via the `datasource` block (for example, `prisma introspect`), the Prisma CLI automatically loads the `DATABASE_URL` environment variables from the `.env` file and makes it available to the CLI. - - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
+When you run a command that needs access to the database defined via the `datasource` block (for example, `prisma db pull`), the Prisma CLI automatically loads the `DATABASE_URL` environment variables from the `.env` file and makes it available to the CLI. ### Using environment variables in your code diff --git a/content/300-guides/200-deployment/110-deployment-guides/400-deploying-to-aws-lambda.mdx b/content/300-guides/200-deployment/110-deployment-guides/400-deploying-to-aws-lambda.mdx index f48a9c6a20..786db2ffad 100644 --- a/content/300-guides/200-deployment/110-deployment-guides/400-deploying-to-aws-lambda.mdx +++ b/content/300-guides/200-deployment/110-deployment-guides/400-deploying-to-aws-lambda.mdx @@ -50,16 +50,9 @@ Prisma supports different workflows depending on whether you integrate with an e This guide starts with an empty database created with plain SQL and looks as follows: 1. Define the database schema using SQL. -1. Run `prisma introspect` locally which will introspect and populate the `schema.prisma` with models based on the database schema. +1. Run `prisma db pull` locally which will introspect and populate the `schema.prisma` with models based on the database schema. 1. Run `prisma generate` which will generate Prisma Client based on the Prisma schema. - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- ## 1. Download the example Open your terminal and navigate to a location of your choice. Create the directory that will hold the application code and download the example code: @@ -150,17 +143,10 @@ Congratulations, you have successfully created the database schema. ## 5. Introspect the database - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- Introspect the database with the Prisma CLI: ```terminal -npx prisma introspect +npx prisma db pull ``` Prisma will introspect the database defined in the `datasource` block of the Prisma schema and populate the Prisma schema with models corresponding to the database tables. diff --git a/content/300-guides/200-deployment/110-deployment-guides/500-deploying-to-netlify.mdx b/content/300-guides/200-deployment/110-deployment-guides/500-deploying-to-netlify.mdx index ad62351812..52fd333d0b 100644 --- a/content/300-guides/200-deployment/110-deployment-guides/500-deploying-to-netlify.mdx +++ b/content/300-guides/200-deployment/110-deployment-guides/500-deploying-to-netlify.mdx @@ -43,16 +43,9 @@ Prisma supports different workflows depending on whether you integrate with an e This guide starts with an empty database created with plain SQL and looks as follows: 1. Define the database schema using SQL. -1. Run `prisma introspect` locally which will introspect and populate the `schema.prisma` with models based on the database schema. +1. Run `prisma db pull` locally which will introspect and populate the `schema.prisma` with models based on the database schema. 1. Run `prisma generate` which will generate Prisma Client based on the Prisma schema. - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- ## 1. Fork the `deployment-example-netlify` repository Go to [`deployment-example-netlify`](https://github.com/prisma/deployment-example-netlify) and **Fork** the repository by clicking on the fork button on the top right corner: @@ -131,17 +124,10 @@ Congratulations, you have successfully created the database schema. ## 5. Introspect the database - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- Introspect the database with the Prisma CLI: ```terminal -npx prisma introspect +npx prisma db pull ``` Prisma will introspect the database defined in the `datasource` block of the Prisma schema and populate the Prisma schema with models corresponding to the database tables. @@ -150,7 +136,7 @@ Prisma will introspect the database defined in the `datasource` block of the Pri ## 6. Commit the Prisma schema to the repository -The result of `prisma introspect` is the `schema.prisma` Prisma schema file. +The result of `prisma db pull` is the `schema.prisma` Prisma schema file. Since the Prisma schema is used to generate Prisma Client, commit it to your repository so that Prisma Client can be generated when Netlify builds the project: diff --git a/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx b/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx index b6238dce12..f451468dc8 100644 --- a/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx +++ b/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx @@ -26,13 +26,6 @@ If you started a development environment based on an initial introspection of a ## Upgrade path for introspection only users - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- Use the following guide if you use introspection only. 1. Enable the `namedConstraints` Preview: @@ -47,7 +40,7 @@ Use the following guide if you use introspection only. 1. Introspect to populate your Prisma schema with any constraint names that do not follow Prisma's naming convention: ```terminal - npx prisma introspect + npx prisma db pull ``` For example, in the following model, the `@id` primary key constraint does not follow Prisma's convention (the conventional name would be `User_pk`): diff --git a/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/01-how-to-upgrade.mdx b/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/01-how-to-upgrade.mdx index 7515814777..6f7a69b30f 100644 --- a/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/01-how-to-upgrade.mdx +++ b/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/01-how-to-upgrade.mdx @@ -88,14 +88,7 @@ On a high-level, the upgrade workflow using the Upgrade CLI looks as follows. For the **initial setup**: 1. You set up Prisma 2 by installing the Prisma 2 CLI and running `npx prisma init`. -1. You connect to your database and introspect it with `npx prisma introspect`. - - - - **Deprecation warning**
- From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
+1. You connect to your database and introspect it with `npx prisma db pull`. ![Prisma CLI introspection flow](https://imgur.com/UiJCG4L.png) @@ -104,7 +97,7 @@ For **fixing the schema incompatibilities**: 1. You invoke the Upgrade CLI with `npx prisma-upgrade`. 1. The Upgrade CLI generates SQL commands for you to run on your database. 1. You run the SQL commands against your database. -1. You run the `prisma introspect` command again. +1. You run the `prisma db pull` command again. 1. You run the `npx prisma-upgrade` command again. 1. The Upgrade CLI adjusts the Prisma 2 schema by adding missing attributes. diff --git a/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx b/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx index f404cda309..afdbbd9922 100644 --- a/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx +++ b/content/300-guides/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer.mdx @@ -522,7 +522,7 @@ These are the different steps of the upgrade process: 1. The Upgrade CLI generates SQL commands for you to run on your database. 2. You run the SQL commands against your database. - 3. You run the `npx prisma introspect` command again. + 3. You run the `npx prisma db pull` command again. 4. You run the `npx prisma-upgrade` command again. 5. The Upgrade CLI adjusts the Prisma 2 schema by adding missing attributes. @@ -961,7 +961,7 @@ After you executed one or more of the previous SQL statements against your datab please run the following two commands to refresh your Prisma 2 schema and check the changes. - 1. Run `npx prisma introspect` again to refresh your Prisma 2 schema. + 1. Run `npx prisma db pull` again to refresh your Prisma 2 schema. 2. Run `npx prisma-upgrade` again. If you can't or don't want to execute the remaining SQL statements right now, you can @@ -1016,7 +1016,7 @@ After you executed one or more of the above SQL statements against your database please run the following two commands to refresh your Prisma 2 Schema and check the changes. - 1. Run `npx prisma introspect` again to refresh your Prisma 2 schema. + 1. Run `npx prisma db pull` again to refresh your Prisma 2 schema. 2. Run `npx prisma-upgrade` again. If you can't or don't want to execute the remaining SQL statements right now, you can @@ -1057,16 +1057,9 @@ At this point, you've resolved the schema incompatibilities with the Upgrade CLI In this section, you'll update your Prisma schema with another introspection round. This time, the previous flaws of the Prisma schema will be resolved because the database schema has been adjusted: ```terminal copy -npx prisma introspect +npx prisma db pull ``` - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. - -
- This time, the resulting Prisma schema looks as follows: ```prisma file=schema.prisma @@ -1163,7 +1156,7 @@ After you executed one or more of the previous SQL statements against your datab please run the following two commands to refresh your Prisma 2 schema and check the changes. - 1. Run `npx prisma introspect` again to refresh your Prisma 2 schema. + 1. Run `npx prisma db pull` again to refresh your Prisma 2 schema. 2. Run `npx prisma-upgrade` again. If you can't or don't want to execute the remaining SQL statements right now, you can diff --git a/content/300-guides/400-migrate-to-prisma/01-migrate-from-typeorm.mdx b/content/300-guides/400-migrate-to-prisma/01-migrate-from-typeorm.mdx index 3bfc0e4337..3131f09e3c 100644 --- a/content/300-guides/400-migrate-to-prisma/01-migrate-from-typeorm.mdx +++ b/content/300-guides/400-migrate-to-prisma/01-migrate-from-typeorm.mdx @@ -247,13 +247,6 @@ npm install prisma --save-dev ## Step 2. Introspect your database - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../reference/api-reference/command-reference#db-pull) command. - -
- ### 2.1. Set up Prisma Before you can introspect your database, you need to set up your [Prisma schema](../../concepts/components/prisma-schema) and connect Prisma to your database. Run the following command in your terminal to create a basic Prisma schema file: @@ -454,7 +447,7 @@ DATABASE_URL="file:./blog-typeorm.db" With your connection URL in place, you can [introspect](../../concepts/components/introspection) your database to generate your Prisma models: ```terminal copy -npx prisma introspect +npx prisma db pull ``` This creates the following Prisma models: diff --git a/content/300-guides/400-migrate-to-prisma/02-migrate-from-sequelize.mdx b/content/300-guides/400-migrate-to-prisma/02-migrate-from-sequelize.mdx index bc759823a6..c976e43187 100644 --- a/content/300-guides/400-migrate-to-prisma/02-migrate-from-sequelize.mdx +++ b/content/300-guides/400-migrate-to-prisma/02-migrate-from-sequelize.mdx @@ -179,13 +179,6 @@ npm install prisma --save-dev ## Step 2. Introspect your database - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../reference/api-reference/command-reference#db-pull) command. - -
- ### 2.1. Set up Prisma Before you can introspect your database, you need to set up your [Prisma schema](../../concepts/components/prisma-schema) and connect Prisma to your database. Run the following command in your terminal to create a basic Prisma schema file: @@ -374,7 +367,7 @@ DATABASE_URL="file:./blog-sequelize.db" With your connection URL in place, you can [introspect](../../concepts/components/introspection) your database to generate your Prisma models: ```terminal copy -npx prisma introspect +npx prisma db pull ``` This creates the following Prisma models: diff --git a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/01-postgresql.mdx b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/01-postgresql.mdx index 2f062c0c7b..b0970203b8 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/01-postgresql.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/01-postgresql.mdx @@ -175,13 +175,6 @@ CREATE UNIQUE INDEX "TheLastUser_firstName_lastName_unique_constraint" ON "TheLa ## 6. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- In the previous sections, you created four tables with unique constraints: - The table `User` has a singe-column unique constraint and index on the `email` column @@ -241,7 +234,7 @@ Here's a short explanation of each component: With both the `schema.prisma` and `.env` files in place, you can run Prisma's introspection with the following command: ```terminal copy -npx prisma introspect +npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/02-mysql.mdx b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/02-mysql.mdx index ce0520b154..9676b8f63e 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/02-mysql.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/02-mysql.mdx @@ -192,13 +192,6 @@ CREATE UNIQUE INDEX `TheLastUser_firstName_lastName_unique_constraint` ON `Uniqu ## 6. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- In the previous sections, you created four tables with unique constraints: - The table `User` has a singe-column unique constraint and index on the `email` column @@ -243,7 +236,7 @@ DATABASE_URL=mysql://janedoe:mypassword@localhost:3306/UniqueDemo With both the `schema.prisma` and `.env` files in place, you can run Prisma's introspection with the following command: ``` -npx prisma introspect +npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/03-sqlite.mdx b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/03-sqlite.mdx index d63d4c7d4d..8de1e08095 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/03-sqlite.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/04-unique-constraints-and-indexes/03-sqlite.mdx @@ -115,13 +115,6 @@ CREATE UNIQUE INDEX "sqlite_autoindex_AnotherUser_1" ON "AnotherUser"("firstName ## 4. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- In the previous sections, you created two tables with unique constraints: - The table `User` has a singe-column unique constraint and index on the `email` column @@ -158,7 +151,7 @@ DATABASE_URL=file:UniqueDemo.db With both the `schema.prisma` and `.env` files in place, you can run Prisma's introspection with the following command: ``` -npx prisma introspect +npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/01-postgresql.mdx b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/01-postgresql.mdx index 42224f5da2..d8d3a41daf 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/01-postgresql.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/01-postgresql.mdx @@ -124,13 +124,6 @@ Congratulations, you just created two tables called `AnotherUser` and `AnotherPo ## 4. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- In the previous sections, you created two different foreign key constraints using four total tables: - The table `Post` has a singe-column foreign key on it's `authorId` column which points to the `id` field of the `User` table. @@ -173,7 +166,7 @@ DATABASE_URL=postgresql://janedoe:mypassword@localhost:5432/ForeignKeyDemo With both the `schema.prisma` and `.env` files in place, you can run Prisma's introspection with the following command: ``` -npx prisma introspect +npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/02-mysql.mdx b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/02-mysql.mdx index 5b4ec07729..c31974178d 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/02-mysql.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/02-mysql.mdx @@ -106,13 +106,6 @@ Congratulations, you just created two tables called `AnotherUser` and `AnotherPo ## 4. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- In the previous sections, you created two different foreign key constraints using four total tables: - The table `Post` has a singe-column foreign key on it's `authorId` column which points to the `id` field of the `User` table. @@ -155,7 +148,7 @@ DATABASE_URL=mysql://janedoe:mypassword@localhost:3306/ForeignKeyDemo With both the `schema.prisma` and `.env` files in place, you can run Prisma's introspection with the following command: ``` -npx prisma introspect +npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/03-sqlite.mdx b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/03-sqlite.mdx index 67aa7e503f..0a9abeec89 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/03-sqlite.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/03-sqlite.mdx @@ -120,13 +120,6 @@ Congratulations, you just created two tables called `AnotherUser` and `AnotherPo ## 4. Introspect your database with Prisma - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../../reference/api-reference/command-reference#db-pull) command. - -
- In the previous sections, you created two times two tables with foreign key constraints: - The table `Post` has a singe-column foreign key on it's `authorId` column which points to the `id` field of the `User` table. @@ -163,7 +156,7 @@ DATABASE_URL=file:../ForeignKeyDemo.db With both the `schema.prisma` and `.env` files in place, you can run Prisma's introspection with the following command: ``` -npx prisma introspect +npx prisma db pull ``` This command introspects your database and for each table adds a Prisma model to the Prisma schema: diff --git a/content/400-reference/200-api-reference/100-prisma-schema-reference.mdx b/content/400-reference/200-api-reference/100-prisma-schema-reference.mdx index 4c06d887c3..d0f3d68c5a 100644 --- a/content/400-reference/200-api-reference/100-prisma-schema-reference.mdx +++ b/content/400-reference/200-api-reference/100-prisma-schema-reference.mdx @@ -873,14 +873,7 @@ The [MongoDB connector](../../concepts/database-connectors/mongodb) does not cur
-The `Unsupported` type was introduced in [2.17.0](https://github.com/prisma/prisma/releases/tag/2.17.0) and allows you to represent data types in the Prisma schema that are not supported by the Prisma Client. `Unsupported` fields can be introspected with `prisma introspect` or created with Prisma Migrate or `db push`. - - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](./command-reference#db-pull) command. - -
+The `Unsupported` type was introduced in [2.17.0](https://github.com/prisma/prisma/releases/tag/2.17.0) and allows you to represent data types in the Prisma schema that are not supported by the Prisma Client. `Unsupported` fields can be introspected with `prisma db pull` or created with Prisma Migrate or `db push`. #### Remarks diff --git a/content/400-reference/200-api-reference/200-command-reference.mdx b/content/400-reference/200-api-reference/200-command-reference.mdx index fdb0d5ad09..c827742111 100644 --- a/content/400-reference/200-api-reference/200-command-reference.mdx +++ b/content/400-reference/200-api-reference/200-command-reference.mdx @@ -378,6 +378,9 @@ The `prisma-client-js` generator creates a customized client for working with yo **MongoDB not supported**
Introspection does not currently support the [MongoDB connector](../../../concepts/database-connectors/mongodb). +**Deprecation warning**
+From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](#db-pull) command. +
The `introspect` command connects to your database and adds Prisma models to your Prisma schema that reflect the current database schema. @@ -420,13 +423,6 @@ datasource db { ##### Analyze the database and write its schema to the `schema.prisma` file - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](#db-pull) command. - -
- @@ -458,7 +454,7 @@ Run prisma generate to generate Prisma Client. ```terminal -prisma introspect --schema=./alternative/schema.prisma +prisma db pull --schema=./alternative/schema.prisma ``` diff --git a/src/components/customMdx/admonition.tsx b/src/components/customMdx/admonition.tsx index b7ec73cb18..dc2608af1f 100644 --- a/src/components/customMdx/admonition.tsx +++ b/src/components/customMdx/admonition.tsx @@ -16,6 +16,8 @@ const colorMap: any = { } const Admonition = ({ children, type, ...props }: AdmonitionProps) => { + console.log({children}) + const isMultiline: boolean = Array.isArray(children) ? true : false; return ( {type === 'alert' && ( @@ -23,13 +25,30 @@ const Admonition = ({ children, type, ...props }: AdmonitionProps) => { )} - {children} + {isMultiline ? ( + + {children.map((child: any, index: number) => ( + + {child.props.children} + + ))} + + ) : children} ) } export default Admonition +const FlexContainer = styled.div` + display: flex; + flex-direction: column; +` + +const ChildContainer = styled.div` + margin: 1rem 0; +` + const AdmonitionWrapper = styled.span<{ type?: string }>` font-family: Inter; font-style: normal; From a343aefb17a2ae39d2e65993529783749338d82f Mon Sep 17 00:00:00 2001 From: Rich Haines Date: Wed, 11 Aug 2021 14:28:36 +0200 Subject: [PATCH 3/4] Changed wrong command --- .../050-enabling-named-constraints.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx b/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx index f451468dc8..798d28994f 100644 --- a/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx +++ b/content/300-guides/300-upgrade-guides/300-upgrading-to-use-preview-features/050-enabling-named-constraints.mdx @@ -105,7 +105,7 @@ To keep existing names, run `prisma db pull` against the target environment with 1. Introspect your **development database** to populate the Prisma schema with constraint and index names in your underlying database _that do not match Prisma's naming convention_: ```terminal - npx prisma migrate introspect + npx prisma db pull ``` In this example, the highlighted constraints did not conform to Prisma's default naming convention and now include the `map` attribute field: From c4324ff7c7ded4f6ac75ca0ca64e7f42b8ef61f1 Mon Sep 17 00:00:00 2001 From: Rich Haines Date: Wed, 11 Aug 2021 15:07:28 +0200 Subject: [PATCH 4/4] Feedback changes --- content/200-concepts/100-components/04-introspection.mdx | 9 +-------- src/components/customMdx/admonition.tsx | 5 ++--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/content/200-concepts/100-components/04-introspection.mdx b/content/200-concepts/100-components/04-introspection.mdx index efe1441f9e..631252f992 100644 --- a/content/200-concepts/100-components/04-introspection.mdx +++ b/content/200-concepts/100-components/04-introspection.mdx @@ -40,14 +40,7 @@ You can learn more about how Prisma maps types from the database to the types av - [MySQL](../database-connectors/mysql) - [SQLite](../database-connectors/sqlite) -## The `prisma introspect` command - - - -**Deprecation warning**
-From Prisma 3.0.0 onwards, the `prisma introspect` command will be deprecated and replaced with the [`prisma db pull`](../../../reference/api-reference/command-reference#db-pull) command. The following will use the `prisma db pull` command. - -
+## The `prisma db pull` command You can introspect your database using the `prisma db pull` command of the [Prisma CLI](prisma-cli/installation). Note that using this command requires your [connection URL](../../reference/database-reference/connection-urls) to be set in your Prisma schema! diff --git a/src/components/customMdx/admonition.tsx b/src/components/customMdx/admonition.tsx index dc2608af1f..d99ce088e1 100644 --- a/src/components/customMdx/admonition.tsx +++ b/src/components/customMdx/admonition.tsx @@ -16,8 +16,7 @@ const colorMap: any = { } const Admonition = ({ children, type, ...props }: AdmonitionProps) => { - console.log({children}) - const isMultiline: boolean = Array.isArray(children) ? true : false; + return ( {type === 'alert' && ( @@ -25,7 +24,7 @@ const Admonition = ({ children, type, ...props }: AdmonitionProps) => { )} - {isMultiline ? ( + {Array.isArray(children) ? ( {children.map((child: any, index: number) => (