Skip to content

Commit

Permalink
add warnings to migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Jan 23, 2024
1 parent b3be089 commit 3a1b5fa
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/pages/upgrade-v3/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: "Upgrade your MySQL database to v3"
---

**Migration must be handled manually or else there's a high likelihood you will lose all your data**. **Do NOT use automated tools as is.** Read this guide carefully as some parts depend on your current structure (**especially the table names**), and feel free to ask questions on our Discord server if you have any questions.

# Upgrade your MySQL database to v3

## Update the adapter
Expand Down Expand Up @@ -44,6 +46,8 @@ UPDATE user_session SET expires_at = FROM_UNIXTIME(idle_expires / 1000);
ALTER TABLE user_session DROP active_expires, DROP idle_expires, MODIFY expires_at DATETIME NOT NULL;
```

You may also just delete the session table and replace it with the [new schema](/database/mysql#schema).

## Replace key table

You can keep using the key table, but we recommend using dedicated tables for each authentication method.
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/upgrade-v3/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: "Upgrade your PostgreSQL database to v3"

# Upgrade your PostgreSQL database to v3

**Migration must be handled manually or else there's a high likelihood you will lose all your data**. **Do NOT use automated tools as is.** Read this guide carefully as some parts depend on your current structure (**especially the table names**), and feel free to ask questions on our Discord server if you have any questions.

## Update the adapter

Install the latest version of the PostgreSQL adapter package.
Expand Down Expand Up @@ -57,6 +59,8 @@ Do a final check and commit the transaction.
COMMIT;
```

You may also just delete the session table and replace it with the [new schema](/database/postgresql#schema).

## Replace key table

You can keep using the key table, but we recommend using dedicated tables for each authentication method.
Expand Down
2 changes: 2 additions & 0 deletions docs/pages/upgrade-v3/prisma/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ title: "Upgrade Prisma and your MySQL database to v3"

The v3 Prisma adapter now requires all fields to be `camelCase`.

**Migration must be handled manually or else there's a high likelihood you will lose all your data**. **Do NOT use Prisma's migration tools as is**. Read this guide carefully as some parts depend on your current structure (**especially the table names**), and feel free to ask questions on our Discord server if you have any questions.

## Update session table

The main change to the session table is that the `idle_expires` and `active_expires` fields are replaced with a single `expiresAt` field. Unlike the previous columns, it's a `DateTime` type. Update the `Session` model. Make sure to add any custom attributes you previously had.
Expand Down
3 changes: 3 additions & 0 deletions docs/pages/upgrade-v3/prisma/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ title: "Upgrade Prisma and your PostgreSQL database to v3"

The v3 Prisma adapter now requires all fields to be `camelCase`.

**Migration must be handled manually or else there's a high likelihood you will lose all your data**. **Do NOT use Prisma's migration tools as is**. Read this guide carefully as some parts depend on your current structure (**especially the table names**), and feel free to ask questions on our Discord server if you have any questions.


## Update session table

The main change to the session table is that the `idle_expires` and `active_expires` fields are replaced with a single `expiresAt` field. Unlike the previous columns, it's a `DateTime` type. Update the `Session` model. Make sure to add any custom attributes you previously had.
Expand Down
2 changes: 2 additions & 0 deletions docs/pages/upgrade-v3/prisma/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ title: "Upgrade Prisma and your SQLite database to v3"

The v3 Prisma adapter now requires all fields to be `camelCase`.

**Migration must be handled manually or else there's a high likelihood you will lose all your data**. **Do NOT use Prisma's migration tools as is**. Read this guide carefully as some parts depend on your current structure (**especially the table names**), and feel free to ask questions on our Discord server if you have any questions.

## Update session table

The main change to the session table is that the `idle_expires` and `active_expires` fields are replaced with a single `expiresAt` field. Unlike the previous columns, it's a `DateTime` type. Update the `Session` model. Make sure to add any custom attributes you previously had.
Expand Down
4 changes: 4 additions & 0 deletions docs/pages/upgrade-v3/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: "Upgrade your SQLite database to v3"

# Upgrade your SQLite database to v3

**Migration must be handled manually or else there's a high likelihood you will lose all your data**. **Do NOT use automated tools as is.** Read this guide carefully as some parts depend on your current structure (**especially the table names**), and feel free to ask questions on our Discord server if you have any questions.

## Update the adapter

Install the latest version of the SQLite adapter package.
Expand Down Expand Up @@ -71,6 +73,8 @@ Check your new `session` table looks right. If not run `ROLLBACK` to rollback th
COMMIT;
```

You may also just delete the session table and replace it with the [new schema](/database/sqlite#schema).

## Replace key table

You can keep using the key table, but we recommend using dedicated tables for each authentication method.
Expand Down

0 comments on commit 3a1b5fa

Please sign in to comment.