Fix migrate.mjs: also convert leagues.created_by from Clerk IDs to UUIDs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cd8074ef10
commit
cdba27a106
1 changed files with 10 additions and 0 deletions
|
|
@ -85,6 +85,16 @@ async function convertForeignKeys(sql) {
|
|||
`;
|
||||
console.log(` commissioners.user_id: ${commissResult.count} rows converted`);
|
||||
|
||||
// Convert leagues.created_by from Clerk IDs to users.id UUIDs
|
||||
const leaguesResult = await sql`
|
||||
UPDATE leagues l
|
||||
SET created_by = u.id::text
|
||||
FROM users u
|
||||
WHERE l.created_by = u.clerk_id
|
||||
AND u.clerk_id IS NOT NULL
|
||||
`;
|
||||
console.log(` leagues.created_by: ${leaguesResult.count} rows converted`);
|
||||
|
||||
// Mark all Clerk users as email-verified (they already verified via Clerk)
|
||||
await sql`
|
||||
UPDATE users
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue