From 266ac9a4ed465cebd9ecfea0fe43ec21cbb439e0 Mon Sep 17 00:00:00 2001 From: mhwelander Date: Tue, 8 Dec 2020 17:06:13 +0100 Subject: [PATCH 1/2] Small link fixes --- .../400-migrate-to-prisma/01-migrate-from-typeorm.mdx | 2 +- .../04-unique-constraints-and-indexes/01-postgresql.mdx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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 86a6e932b7..69c117c1ee 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 @@ -16,7 +16,7 @@ You can learn how Prisma compares to TypeORM on the [Prisma vs TypeORM](../../co ## Overview of the migration process Note that the steps for migrating from TypeORM to Prisma are always the same, no matter what kind of application or API layer you're building: - + 1. Install the Prisma CLI 1. Introspect your database 1. Install Prisma Client 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 da0a778cf7..431658673b 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 @@ -192,7 +192,7 @@ npm init -y npm install @prisma/cli --save-dev ``` -Next, set up your Prisma project by creating your [Prisma schema](../../../concepts/components/prisma-schema) file with the following command: +Next, set up your Prisma project by creating your [Prisma schema](../../../../../concepts/components/prisma-schema) file with the following command: ```terminal copy npx prisma init @@ -203,7 +203,7 @@ This command created a new directory called `prisma` with the following contents - `schema.prisma`: The Prisma schema with your database connection and the Prisma Client generator - `.env`: A [dotenv](https://github.com/motdotla/dotenv) file for defining environment variables (used for your database connection) -To connect your database, you need to set the `url` field of the `datasource` block in your Prisma schema to your database [connection URL](../../../reference/database-reference/connection-urls): +To connect your database, you need to set the `url` field of the `datasource` block in your Prisma schema to your database [connection URL](../../../../reference/database-reference/connection-urls): ```prisma file=prisma/schema.prisma datasource db { @@ -212,7 +212,7 @@ datasource db { } ``` -In this case, the `url` is [set via an environment variable](../../../concepts/components/prisma-schema#using-environment-variables) which is defined in `prisma/.env`: +In this case, the `url` is [set via an environment variable](../../../../concepts/components/prisma-schema#using-environment-variables) which is defined in `prisma/.env`: ```js file=prisma/.env DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" From ec0615d3d6c402852aca58cf53c64bf92bcdfd38 Mon Sep 17 00:00:00 2001 From: mhwelander Date: Tue, 8 Dec 2020 17:23:01 +0100 Subject: [PATCH 2/2] Link fixes --- content/100-getting-started/01-quickstart.mdx | 2 +- .../050-overview/100-what-is-prisma/100-data-modeling.mdx | 4 ++-- .../200-concepts/100-components/02-prisma-client/index.mdx | 2 +- .../03-prisma-migrate/050-prisma-migrate-flows.mdx | 4 ++-- .../100-components/03-prisma-migrate/100-legacy-migrate.mdx | 2 +- .../200-concepts/100-components/03-prisma-migrate/index.mdx | 2 +- .../07-preview-features/100-sql-server/index.mdx | 2 +- .../100-add-prisma-migrate-to-a-project.mdx | 4 ++-- .../02-schema-incompatibilities.mdx | 2 +- .../300-upgrade-guides/02-upgrade-from-graphcool.mdx | 6 +++--- .../04-unique-constraints-and-indexes/01-postgresql.mdx | 2 +- .../100-database-workflows/05-foreign-keys/index.mdx | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/content/100-getting-started/01-quickstart.mdx b/content/100-getting-started/01-quickstart.mdx index bf4fd3b4a9..bbc758fbdf 100644 --- a/content/100-getting-started/01-quickstart.mdx +++ b/content/100-getting-started/01-quickstart.mdx @@ -34,7 +34,7 @@ For demonstration purposes of this guide, you will use a local [SQLite](https:// If you're looking to set up Prisma with your own database, you have these options: -- [Set up a new project with Prisma from scratch](setup-prisma/start-from-scratch-sql) +- [Set up a new project with Prisma from scratch](setup-prisma/start-from-scratch) - [Add Prisma to an existing project](setup-prisma/add-to-existing-project) 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 e46c1c1278..31584a3c8f 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 @@ -154,7 +154,7 @@ The resulting `user` object is an instance of Sequelize's `Model` class (because ## Data modeling with Prisma -Depending on which parts of Prisma you want to use in your application, the data modeling flow looks slightly different. The following two sections explain the workflows for using [**only Prisma Client**](#using-only-prisma-client) and using [**Prisma Client and Prisma Migrate (Preview)**](##using-prisma-client-and-prisma-migrate-preview). +Depending on which parts of Prisma you want to use in your application, the data modeling flow looks slightly different. The following two sections explain the workflows for using [**only Prisma Client**](#using-only-prisma-client) and using [**Prisma Client and Prisma Migrate (Preview)**](#using-prisma-client-and-prisma-migrate-preview). No matter which approach though, with Prisma you never create application models in your programming language by manually defining classes, interfaces, or structs. Instead, the application models are defined in your [Prisma schema](../../components/prisma-schema): @@ -213,7 +213,7 @@ 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 -### Using Prisma Client and Prisma Migrate (Experimental) +### Using Prisma Client and Prisma Migrate (Preview) > **Warning**: Prisma Migrate is currently in an Experimental state. It is ready to be tested and can be used in non-critical projects. However, it is not yet considered ready for production usage. diff --git a/content/200-concepts/100-components/02-prisma-client/index.mdx b/content/200-concepts/100-components/02-prisma-client/index.mdx index 1c767158b6..a653baa2e2 100644 --- a/content/200-concepts/100-components/02-prisma-client/index.mdx +++ b/content/200-concepts/100-components/02-prisma-client/index.mdx @@ -16,7 +16,7 @@ The setup instructions [below](#set-up) provide a high-level overview of the ste Set up a new project from scratch diff --git a/content/200-concepts/100-components/03-prisma-migrate/050-prisma-migrate-flows.mdx b/content/200-concepts/100-components/03-prisma-migrate/050-prisma-migrate-flows.mdx index d9a366930a..68792ddc4a 100644 --- a/content/200-concepts/100-components/03-prisma-migrate/050-prisma-migrate-flows.mdx +++ b/content/200-concepts/100-components/03-prisma-migrate/050-prisma-migrate-flows.mdx @@ -61,7 +61,7 @@ Use the following command in non-development environments to apply migrations: prisma migrate deploy --preview-feature ``` -The `prisma migrate dev --preview-feature` command is reserved for development environments and requires the [shadow database](../#shadow-database), which is not available in production. +The `prisma migrate dev --preview-feature` command is reserved for development environments and requires the [shadow database](./#shadow-database), which is not available in production. ## Collaborating with a team @@ -110,7 +110,7 @@ If Prisma Migrate detects a migration history conflict when you run `prisma migr Database schema drift occurs when your database schema is out of sync with your migration history - the database schema has 'drifted away' from the source of truth. Schema drift can occur if: -* The database schema was changed _without_ using migrations - for example, by using [`prisma db push`](../../reference/api-reference/command-reference#db-push) or manually changing the database schema. +* The database schema was changed _without_ using migrations - for example, by using [`prisma db push`](../../../reference/api-reference/command-reference#db-push) or manually changing the database schema. > **Note**: Schema drift can only be detected in a development environment as this requires the shadow database. diff --git a/content/200-concepts/100-components/03-prisma-migrate/100-legacy-migrate.mdx b/content/200-concepts/100-components/03-prisma-migrate/100-legacy-migrate.mdx index 4906a71e20..b992d89284 100644 --- a/content/200-concepts/100-components/03-prisma-migrate/100-legacy-migrate.mdx +++ b/content/200-concepts/100-components/03-prisma-migrate/100-legacy-migrate.mdx @@ -16,7 +16,7 @@ Legacy Prisma Migrate is a tool that lets you _change your database schema_, e.g ### Legacy Prisma Migrate vs the `db push` (Preview) command -If you want to prototype or iterate on a schema design in a development environment, consider the [`db push` command](../../../reference/api-reference/command-reference#db-push). +If you want to prototype or iterate on a schema design in a development environment, consider the [`db push` command](../../../../reference/api-reference/command-reference#db-push). ### Legacy Prisma Migrate vs SQL migrations diff --git a/content/200-concepts/100-components/03-prisma-migrate/index.mdx b/content/200-concepts/100-components/03-prisma-migrate/index.mdx index 13ede8eff0..c38bd0c8a2 100644 --- a/content/200-concepts/100-components/03-prisma-migrate/index.mdx +++ b/content/200-concepts/100-components/03-prisma-migrate/index.mdx @@ -255,4 +255,4 @@ The `prisma migrate dev --preview-feature` and `prisma migrate reset --preview-f ### Native types preview not yet supported -Prisma Migrate does not yet support [native database type attributes (Preview)](preview-features/native-types). +Prisma Migrate does not yet support [native database type attributes (Preview)](../preview-features/native-types). diff --git a/content/200-concepts/100-components/07-preview-features/100-sql-server/index.mdx b/content/200-concepts/100-components/07-preview-features/100-sql-server/index.mdx index 0754d01ec5..818ffbdf68 100644 --- a/content/200-concepts/100-components/07-preview-features/100-sql-server/index.mdx +++ b/content/200-concepts/100-components/07-preview-features/100-sql-server/index.mdx @@ -41,7 +41,7 @@ Alternatively, follow the [Microsoft SQL Server tutorial](sql-server-start-from- ### Type mappings with `nativeTypes` preview enabled -See [native types mapping reference](../../native-types/native-types-mappings). +See [native types mapping reference](../native-types/native-types-mappings). ### Type mappings with `nativeTypes` preview disabled diff --git a/content/300-guides/100-prisma-guides/100-prisma-migrate-guides/100-add-prisma-migrate-to-a-project.mdx b/content/300-guides/100-prisma-guides/100-prisma-migrate-guides/100-add-prisma-migrate-to-a-project.mdx index 557f70a0a9..bc59ae42f6 100644 --- a/content/300-guides/100-prisma-guides/100-prisma-migrate-guides/100-add-prisma-migrate-to-a-project.mdx +++ b/content/300-guides/100-prisma-guides/100-prisma-migrate-guides/100-add-prisma-migrate-to-a-project.mdx @@ -5,9 +5,9 @@ metaDescription: Learn how to add Prisma Migrate (Preview) to an existing projec -This guide describes how to add [Prisma Migrate (Preview)](../../concepts/components/prisma-migrate) to an existing project, including upgrading from the experimental version of Prisma Migrate. +This guide describes how to add [Prisma Migrate (Preview)](../../../concepts/components/prisma-migrate) to an existing project, including upgrading from the experimental version of Prisma Migrate. -For users who are transitioning from the experimental Prisma Migrate, the flow is conceptually very similar. +* For users who are transitioning from the experimental Prisma Migrate, the flow is conceptually very similar. * For users coming from a third party migration tool, the flow differs from the old "introspection flow". With Prisma Migrate (Preview), you no longer modify your database schema and then use `prisma introspect` to pull the changes into your Prisma schema. diff --git a/content/300-guides/300-upgrade-guides/01-upgrade-from-prisma-1/02-schema-incompatibilities.mdx b/content/300-guides/300-upgrade-guides/01-upgrade-from-prisma-1/02-schema-incompatibilities.mdx index 39e5a80b1e..7b779f6f34 100644 --- a/content/300-guides/300-upgrade-guides/01-upgrade-from-prisma-1/02-schema-incompatibilities.mdx +++ b/content/300-guides/300-upgrade-guides/01-upgrade-from-prisma-1/02-schema-incompatibilities.mdx @@ -873,7 +873,7 @@ Prisma 1 supports configuration of cascading deletes via the `@relation(onDelete If your relation is configured via `table: INLINE`, you can still get the same behaviour by configuring cascading deletes directly in your database. If your relation is represented via a relation table, you need to manually implement cascading deletes in your application code. -Cascading deletes are not yet supported in Prisma 2. For _inline_ relations, you can configure similar behaviour as in Prisma 1 in plain SQL (find the guides [here](../../database-workflows/cascading-deletes/postgresql)). For relations that were represented as relation tables in Prisma 1, you won't be able to configure cascading deletes on the database layer for now and might have to resort to implementing it inside your application code with Prisma Client. +Cascading deletes are not yet supported in Prisma 2. For _inline_ relations, you can configure similar behaviour as in Prisma 1 in plain SQL (find the guides [here](../../general-guides/database-workflows/cascading-deletes/postgresql)). For relations that were represented as relation tables in Prisma 1, you won't be able to configure cascading deletes on the database layer for now and might have to resort to implementing it inside your application code with Prisma Client. > **Note**: If you need to implement cascading deletes in your application layer, this [tool](https://paljs.com/plugins/delete) by our community member [Ahmed Elywa](https://github.com/AhmedElywa/) might come in handy. diff --git a/content/300-guides/300-upgrade-guides/02-upgrade-from-graphcool.mdx b/content/300-guides/300-upgrade-guides/02-upgrade-from-graphcool.mdx index 1c7769ed84..49ea0db024 100644 --- a/content/300-guides/300-upgrade-guides/02-upgrade-from-graphcool.mdx +++ b/content/300-guides/300-upgrade-guides/02-upgrade-from-graphcool.mdx @@ -45,7 +45,7 @@ Because Graphcool and and Prisma 2 are very different, it might be a viable opti On a high-level, the migration path from Graphcool to Prisma 2 looks as follows: 1. Create SQL dump of Graphcool project using the [Graphcool Exporter](https://export.graph.cool/) -1. [Import](../database-workflows/import-and-export-data/mysql) the dump into a MySQL database +1. [Import](https://www.prisma.io/dataguide/mysql/importing-and-exporting-data-in-mysql) the dump into a MySQL database 1. [Introspect](../../concepts/components/introspection) your database with Prisma 2.0 1. Create CRUD GraphQL API with [Nexus](https://nexusjs.org) (and optionally [`nexus-plugin-prisma`](https://github.com/graphql-nexus/nexus-plugin-prisma)) @@ -58,10 +58,10 @@ Open the Graphcool Exporter at [`https://export.graph.cool/`](https://export.gra Then grab your permanent auth token from the **Settings > Authentication > Permanent Auth Tokens** area in the [Graphcool console](https://console.graph.cool) and paste it into the text field. Now click **Export**. This downloads a zipped `.sql` file with a dump of all the data that's stored in your Graphcool project. - + ## 2. Import the SQL dump into your own MySQL database -Follow the [guide](../database-workflows/import-and-export-data/mysql#importing-data-from-sql-files) that explains how to import data into a MySQL database. +Follow the [guide](https://www.prisma.io/dataguide/postgresql/inserting-and-modifying-data/importing-and-exporting-data-in-postgresql#importing-data-from-sql-files) that explains how to import data into a MySQL database. ## 3. Introspect your database with Prisma 2 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 431658673b..76506a4c46 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 @@ -211,7 +211,7 @@ datasource db { url = env("DATABASE_URL") } ``` - + In this case, the `url` is [set via an environment variable](../../../../concepts/components/prisma-schema#using-environment-variables) which is defined in `prisma/.env`: ```js file=prisma/.env diff --git a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/index.mdx b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/index.mdx index 80069bbcf9..2d42e82c9b 100644 --- a/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/index.mdx +++ b/content/300-guides/600-general-guides/100-database-workflows/05-foreign-keys/index.mdx @@ -8,7 +8,7 @@ toc: false A foreign key links data in one table to data in another table. For example, records in a `Posts` table might have a foreign key named `authorId` that refers to the `id` column of the `User` table. This relationship makes it possible to, for example, find all blog posts by a particular author. -The Prisma schema represents tables as models, and connections between two models are called [relations](../../../concepts/components/prisma-schema/relations). You can [filter and query by relations](../../../concepts/components/prisma-client/relation-queries) - for example, you can get all posts where the author's email address contains _"prisma.io"_. +The Prisma schema represents tables as models, and connections between two models are called [relations](../../../../concepts/components/prisma-schema/relations). You can [filter and query by relations](../../../../concepts/components/prisma-client/relation-queries) - for example, you can get all posts where the author's email address contains _"prisma.io"_. This section describes how to configure foreign key relationships for different databases. When you introspect a database, these relationships are represented in the Prisma schema as **relations**.