Skip to content

Commit

Permalink
Merge branch 'new-audit-table' of github.com:unkeyed/unkey into new-a…
Browse files Browse the repository at this point in the history
…udit-table
  • Loading branch information
ogzhanolguncu committed Dec 19, 2024
2 parents a9fa368 + dd12450 commit b237b96
Show file tree
Hide file tree
Showing 37 changed files with 40 additions and 654 deletions.
38 changes: 38 additions & 0 deletions apps/engineering/content/rfcs/0006-auth-migration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: 0006 Auth Migration
description: Migrate everything to WorkOS, despite their bad APIs..
date: 2024-12-18
authors:
- Andreas Thomas
- James Perkins
---


## Motivation

We need to migrate our users and organisations from Clerk to WorkOS.


## Detailed design


In order to apply the changes safely and, more importantly, roll back in case we need to, we'll need to do it in 3 steps.
Each step should be its own PR, so we can roll back safely.


### 1. Migrate Data

1. Create a new non-nullable varchar column in our `workspaces` table with default `""`.
2. Migrate all users from Clerk to WorkOS. They will receive a new `user_id`, which is fine.
3. Migrate all organisations and personal workspaces from Clerk to WorkOS. These will also have a new `org_id`, which we will store in the `workspaces.organisation_id` column.

### 2. Switch Reads
(Meg's PR)

We deploy the dashboard changes to production, which will now receive an `orgId` from the WorkOS SDK and change our db queries to match against the `organisation_id` field, instead of `tenant_id`.
If we really need to, we can roll this back at any time and use clerk again. The only problem here is that users that were created after the switch, would not be in Clerk.


### 3. Remove old columns

After we're happy with everything and it's been running smoothly for a few weeks, we can remove the old `tenant_id` column.
36 changes: 0 additions & 36 deletions apps/planetfall/.gitignore

This file was deleted.

153 changes: 0 additions & 153 deletions apps/planetfall/CHANGELOG.md

This file was deleted.

36 changes: 0 additions & 36 deletions apps/planetfall/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/arn/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/bom/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/cdg/route.ts

This file was deleted.

41 changes: 0 additions & 41 deletions apps/planetfall/app/api/check/check.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/cle/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/cpt/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/dub/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/fra/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/gru/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/hkg/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/hnd/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/iad/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/icn/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/kix/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/lhr/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/pdx/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/sfo/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/sin/route.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/planetfall/app/api/check/syd/route.ts

This file was deleted.

Binary file removed apps/planetfall/app/favicon.ico
Binary file not shown.
Loading

0 comments on commit b237b96

Please sign in to comment.