Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/scripts/generate-redirects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ do
body="$body""\`\`\`%0A"
fi

# name pieces
# name pieces (and replace `/index` from files (to get to a filename that would be equivalent))
action=${values[0]}
path1=${values[1]}
path2=${values[3]}
path1=$(echo "${values[1]}" | sed -e 's#/index##g' )
path2=$(echo "${values[3]}" | sed -e 's#/index##g' )

# Skip if file names are identical (probably via `/index` replacement above)
if [[ "$path1" == "$path2" ]]; then
continue
fi

# clean paths
path1_cleaned=$(echo "$path1" | sed -E 's:content/:/:g' | sed -E 's:/index.mdx::g' | sed -e 's/.mdx//g' | sed -E 's:/[0-9]+-:/:g' )
path2_cleaned=$(echo "$path2" | sed -E 's:content/:/:g' | sed -E 's:/index.mdx::g' | sed -e 's/.mdx//g' | sed -E 's:/[0-9]+-:/:g' )
path1_cleaned=$(echo "$path1" | sed -E 's:content/:/:g' | sed -e 's/.mdx//g' | sed -E 's:/[0-9]+-:/:g' )
path2_cleaned=$(echo "$path2" | sed -E 's:content/:/:g' | sed -e 's/.mdx//g' | sed -E 's:/[0-9]+-:/:g' )

# special case for deletion
if [[ "${values[0]}" == "D" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Prisma Client is an auto-generated database client that's tailored to your datab

To generate and instantiate Prisma Client:

1. Ensure that you have [Prisma CLI installed on your machine](/concepts/components/prisma-cli/installation).
1. Ensure that you have [Prisma CLI installed on your machine](/reference/api-reference/command-reference#installation).

1. Add the following `generator` definition to your Prisma schema:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ model User {
}
```

Also make sure to [install the Prisma CLI](/concepts/components/prisma-cli/installation):
Also make sure to [install the Prisma CLI](/reference/api-reference/command-reference#installation):

```
npm install prisma --save-dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ hidePage: true

> **Important!** This page documents legacy Prisma Migrate (Experimental) available in version 2.12.0 and earlier. [Prisma Migrate](.) is available in version [2.13.0](https://github.com/prisma/prisma/releases/tag/2.13.0) and Generally Available in [2.19.0](https://github.com/prisma/prisma/releases/tag/2.19.0).

Legacy Prisma Migrate is a tool that lets you _change your database schema_, e.g. by creating new tables or adding columns to existing tables. These changes are called _schema migrations_. legacy Prisma Migrate is available as part of the [Prisma CLI](/concepts/components/prisma-cli/installation) via the `legacy Prisma Migrate` command.
Legacy Prisma Migrate is a tool that lets you _change your database schema_, e.g. by creating new tables or adding columns to existing tables. These changes are called _schema migrations_. legacy Prisma Migrate is available as part of the [Prisma CLI](/reference/api-reference/command-reference#installation) via the `legacy Prisma Migrate` command.

</TopBlock>

Expand Down
122 changes: 0 additions & 122 deletions content/200-concepts/100-components/05-prisma-cli/01-installation.mdx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ You can install the Prisma 2 CLI in your Node.js project as follows (be sure to
npm install prisma --save-dev
```

> **Note**: With Prisma 1, it was usually recommended to install the CLI globally. We now recommend to [install the Prisma CLI locally](/concepts/components/prisma-cli/installation#local-installation-recommended) to prevent version conflicts.
> **Note**: With Prisma 1, it was usually recommended to install the CLI globally. We now recommend to [install the Prisma CLI locally](/reference/api-reference/command-reference#installation#local-installation-recommended) to prevent version conflicts.

You can now use the local installation of the `prisma` CLI by prefixing it with `npx`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ As mentioned before, this guide is an extended variation of the TypeORM Express

## Step 1. Install the Prisma CLI

The first step to adopt Prisma is to [install the Prisma CLI](/concepts/components/prisma-cli/installation#local-installation-recommended) in your project:
The first step to adopt Prisma is to [install the Prisma CLI](/reference/api-reference/command-reference#installation#local-installation-recommended) in your project:

```terminal copy
npm install prisma --save-dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ In this guide, the route handlers are located in the `src/controllers` directory

## Step 1. Install the Prisma CLI

The first step to adopt Prisma is to [install the Prisma CLI](/concepts/components/prisma-cli/installation#local-installation-recommended) in your project:
The first step to adopt Prisma is to [install the Prisma CLI](/reference/api-reference/command-reference#installation#local-installation-recommended) in your project:

```terminal copy
npm install prisma --save-dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You can learn how Prisma compares to Mongoose on the [Prisma vs Mongoose](/conce

Note that the steps for migrating from Mongoose to Prisma are always the same, no matter what kind of application or API layer you're building:

1. [Install the Prisma CLI](/concepts/components/prisma-cli/installation)
1. [Install the Prisma CLI](/reference/api-reference/command-reference#installation)
1. [Introspect your database](/concepts/components/introspection)
1. [Install Prisma Client](/concepts/components/prisma-client#2-installation)
1. Gradually replace your Mongoose queries with Prisma Client
Expand Down Expand Up @@ -147,7 +147,7 @@ Run `npm run seed` to populate your database with the sample data in the `./src/

## Step 1. Install the Prisma CLI

The first step to adopt Prisma is to [install the Prisma CLI](/concepts/components/prisma-cli/installation#local-installation-recommended) in your project:
The first step to adopt Prisma is to [install the Prisma CLI](/reference/api-reference/command-reference#installation#local-installation-recommended) in your project:

```terminal copy
npm install prisma --save-dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,72 @@ This document describes the Prisma CLI commands, arguments, and options.

</TopBlock>

## Installation

The Prisma CLI is typically installed locally as a **development dependency**, that's why the `--save-dev` (npm) and `--dev` (Yarn) options are used in the commands below.

<Admonition>

We **recommend that you install the Prisma CLI locally** in your project's `package.json` to avoid version conflicts that can happen with a global installation.

</Admonition>

### npm

Install with [npm](https://www.npmjs.com/):
Comment thread
ruheni marked this conversation as resolved.

```
npm install prisma --save-dev
```

### Yarn

Install with [yarn](https://yarnpkg.dev/):

```
yarn add prisma --save-dev
```

### pnpm

Install with [pnpm](https://pnpm.io/):

```
pnpm install prisma --save-dev
```

Comment thread
ruheni marked this conversation as resolved.
<details>
<summary>Global installation (Not recommended)</summary>

- **npm**

Install with npm:

```
npm install -g prisma
```

- **Yarn**

Install with Yarn:

```
yarn global add prisma
```

- **pnpm**

Install with pnpm:

```
pnpm install prisma --global
```

</details>

## Usage

If you installed Prisma with a package manager, you need to prefix the `prisma` command with your package runner.
If you installed Prisma as a development dependency, you need to prefix the `prisma` command with your package runner.

### npm

Expand Down Expand Up @@ -1321,3 +1384,12 @@ See [Seeding your database](/guides/migrate/seed-database) <span class="guide"><
```

This is available from version 3.0.1 and later.

## Using a HTTP proxy for the CLI

Prisma CLI supports [custom HTTP proxies](https://github.com/prisma/prisma/issues/506). This is particularly relevant when being behind a corporate firewall.

To activate usage of the proxy, provide either of the following environment variables:

- [`HTTP_PROXY`](/reference/api-reference/environment-variables-reference#http_proxy) <span class="api"></span> or `http_proxy`: Proxy URL for http traffic, for example `http://localhost:8080`
- [`HTTPS_PROXY`](/reference/api-reference/environment-variables-reference#https_proxy) <span class="api"></span> or `https_proxy`: Proxy URL for https traffic, for example `https://localhost:8080`
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ To configure `prisma generate` to [generate a Prisma Client for Data Proxy](/dat

## Proxy environment variables

The Prisma CLI supports custom HTTP(S) proxies to download the Prisma engines. These can be helpful to use when working behind a corporate firewall. See [Using a HTTP proxy for the CLI](/concepts/components/prisma-cli/installation#using-a-http-proxy-for-the-cli) for more information.
The Prisma CLI supports custom HTTP(S) proxies to download the Prisma engines. These can be helpful to use when working behind a corporate firewall. See [Using a HTTP proxy for the CLI](/reference/api-reference/command-reference#installation#using-a-http-proxy-for-the-cli) for more information.

### <inlinecode>NO_PROXY</inlinecode>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ datasource db {
<Admonition type="warn">

`prisma studio` currently doesn't support the `directUrl` property.

</Admonition>

Then add the `DIRECT_URL` environment variable to your [`.env` file](/guides/development-environment/environment-variables#using-env-files):
Expand Down
4 changes: 4 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,10 @@
{
"source": "/docs/guides/database/advanced-database-tasks",
"destination": "/docs/guides/other/advanced-database-tasks"
},
{
"source": "/docs/concepts/components/prisma-cli/installation",
"destination": "/docs/reference/api-reference/command-reference#installation"
}
]
}