Fix foreign key constraint error when creating proxy hosts
The issue occurred because the auth system uses a hardcoded JWT user ID (1) that didn't exist in the database, causing foreign key constraint violations when creating proxy hosts. Changes: - Added init-db.ts to ensure admin user exists in database - Added instrumentation.ts to run DB initialization on server startup - Admin user (from ADMIN_USERNAME env var) is now created with ID 1 - Matches the hardcoded ID in auth.ts for JWT tokens Fixes foreign key constraint error (P2003) when creating proxy hosts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2
next-env.d.ts
vendored
2
next-env.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
import "./.next/dev/types/routes.d.ts";
|
||||
import "./.next/types/routes.d.ts";
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
|
||||
Reference in New Issue
Block a user