Skip to content

Commit

Permalink
Small migration guide fixes (#2193)
Browse files Browse the repository at this point in the history
  • Loading branch information
sodic authored Jul 17, 2024
1 parent ee2c57c commit 65300ff
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions web/docs/migrate-from-0-13-to-0-14.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,24 @@ Wasp introduced a much simpler API for accessing user auth fields like `username

To migrate your app to Wasp 0.14.x, you must:

1. Update your `tsconfig.json`.
1. Bump the version in `main.wasp` and update your `tsconfig.json`.
2. Migrate your entities into the new `schema.prisma` file.
3. Update code that accesses user fields.

### Update your `tsconfig.json`
### Bump the version and update `tsconfig.json`

To ensure your project works correctly with Wasp 0.14.0, you must update your
Let's start with something simple. Update the version field in your Wasp file to `^0.14.0`:

```wasp title="main.wasp"
app MyApp {
wasp: {
// highlight-next-line
version: "^0.14.0"
},
}
```

To ensure your project works correctly with Wasp 0.14.0, you must also update your
`tsconfig.json` file.

If you haven't changed anything in your project's `tsconfig.json` file (this is
Expand Down Expand Up @@ -380,15 +391,10 @@ generator client {
}
```

7\. **Run the Wasp CLI** to generate the Prisma client

Regenerate the Prisma client by running the following command:
All that's left to do is migrate the database.

```bash
wasp db migrate-dev
```

This command generates the Prisma client based on the `schema.prisma` file.
To avoid type errors, it's best to take care of database migrations after you've migrated the rest of the code.
So, just keep reading, and we will remind you to migrate the database as [the last step of the migration guide](#migrate-the-database).

Read more about the [Prisma Schema File](./data-model/prisma-file.md) and how Wasp uses it to generate the database schema and Prisma client.

Expand Down Expand Up @@ -643,6 +649,18 @@ Follow the steps below to migrate:
</TabItem>
</Tabs>

### Migrate the database

Finally, you can **Run the Wasp CLI** to regenerate the new Prisma client:

```bash
wasp db migrate-dev
```

This command generates the Prisma client based on the `schema.prisma` file.

Read more about the [Prisma Schema File](./data-model/prisma-file.md) and how Wasp uses it to generate the database schema and Prisma client.

That's it!

You should now be able to run your app with the new Wasp 0.14.0. We recommend reading through the updated [Accessing User Data](./auth/entities/entities.md) section to get a better understanding of the new API.

0 comments on commit 65300ff

Please sign in to comment.