mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-26 10:35:04 +03:00
Small migration guide fixes (#2193)
This commit is contained in:
parent
ee2c57cb2b
commit
65300ff1a9
@ -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:
|
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.
|
2. Migrate your entities into the new `schema.prisma` file.
|
||||||
3. Update code that accesses user fields.
|
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.
|
`tsconfig.json` file.
|
||||||
|
|
||||||
If you haven't changed anything in your project's `tsconfig.json` file (this is
|
If you haven't changed anything in your project's `tsconfig.json` file (this is
|
||||||
@ -380,15 +391,10 @@ generator client {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
7\. **Run the Wasp CLI** to generate the Prisma client
|
All that's left to do is migrate the database.
|
||||||
|
|
||||||
Regenerate the Prisma client by running the following command:
|
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).
|
||||||
```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.
|
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.
|
||||||
|
|
||||||
@ -643,6 +649,18 @@ Follow the steps below to migrate:
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</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!
|
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.
|
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user