Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions app/api/auth/unclaim/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 11 additions & 0 deletions db/migrations/014_fix_rel_type_arrays.sql
Original file line number Diff line number Diff line change
@@ -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';