diff --git a/app/api/auth/unclaim/route.ts b/app/api/auth/unclaim/route.ts index f7e6e68..2bc4060 100644 --- a/app/api/auth/unclaim/route.ts +++ b/app/api/auth/unclaim/route.ts @@ -27,14 +27,6 @@ export async function POST(request: NextRequest) { ); } - // Safety: don't let admins unclaim *other* admins (self-unclaim is fine) - if (targetUser.is_admin && targetUser.id !== user.id) { - return NextResponse.json( - { error: 'Cannot unclaim another admin user' }, - { status: 403 } - ); - } - const personCount = await countUserPersons(targetUser.id); if (personCount <= 1) { diff --git a/db/migrations/014_fix_rel_type_arrays.sql b/db/migrations/014_fix_rel_type_arrays.sql new file mode 100644 index 0000000..f02ed67 --- /dev/null +++ b/db/migrations/014_fix_rel_type_arrays.sql @@ -0,0 +1,11 @@ +-- Migration 014: Fix rel_type source/target arrays +-- Catch-up for changes added to 013 after it had already run in production. +-- All statements are idempotent (setting to the correct final state). + +-- facilitates: ensure 'organization' is in source_types +UPDATE rel_types SET source_types = '{person,organization,catalyst}' +WHERE key = 'facilitates'; + +-- created: ensure 'program' is in target_types +UPDATE rel_types SET target_types = '{project,event,program}' +WHERE key = 'created';