stack/apps
Zai Shi aacbdf4dd6
Fix OAuth provider migration (#793)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Fixes OAuth provider migration by updating schema, constraints, and
foreign keys in `ProjectUserOAuthAccount`, `OAuthAccessToken`, and
`OAuthToken`.
> 
>   - **Schema Changes**:
> - `ProjectUserOAuthAccount`: Add `allowConnectedAccounts` and
`allowSignIn` columns with default `true`. Add `id` column, generate
UUIDs for existing rows, set `id` as NOT NULL and primary key.
> - `OAuthAccessToken` and `OAuthToken`: Add `oauthAccountId` column,
update with `ProjectUserOAuthAccount.id`, drop `configOAuthProviderId`
and `providerAccountId` columns, set `oauthAccountId` as NOT NULL.
>   - **Constraints and Indexes**:
> - Add unique index on `OAuthAuthMethod` for `tenancyId`,
`projectUserId`, `configOAuthProviderId`.
> - Add foreign keys linking `OAuthAuthMethod`, `OAuthToken`, and
`OAuthAccessToken` to `ProjectUserOAuthAccount`.
>     - Drop `ConnectedAccount` table.
>   - **Misc**:
>     - `ProjectUserOAuthAccount`: Allow `projectUserId` to be NULL.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for a27230eb54. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
2025-07-23 19:19:47 +02:00
..
backend Fix OAuth provider migration (#793) 2025-07-23 19:19:47 +02:00
dashboard Add an OAuth provider for Twitch (#728) 2025-07-23 02:31:47 +02:00
dev-launchpad chore: update package versions 2025-07-18 10:28:03 -07:00
e2e maximum of 5 retries for webhooks 2025-07-22 15:40:42 -07:00
mcp-server chore: update package versions 2025-07-18 10:28:03 -07:00
mock-oauth-server chore: update package versions 2025-07-18 10:28:03 -07:00
oauth-mock-server In-source unit tests (#429) 2025-02-14 11:47:52 -08:00