Skip to content

Bug: API Key creation fails: "configId does not exist in apikey Drizzle schema" (better-auth api-key@1.5.4) #4026

@Mheaus

Description

@Mheaus

To Reproduce

  1. install last version
  2. create api key

Current vs. Expected behavior

Creating an api key should work

Provide environment information

Operating System:

• OS: Ubuntu 24.04 LTS
• Arch: amd64

Dokploy version: 0.28.7

VPS Provider: Scaleway

What applications/services are you trying to deploy? — N/A

Which area(s) are affected? (Select all that apply)

Application

Are you deploying the applications where Dokploy is installed or on a remote server?

Both

Additional context

Bug

When trying to create an API key via Settings → API Keys, the following error is returned:

The field "configId" does not exist in the "apikey" Drizzle schema.
Please update your drizzle schema or re-generate using "npx auth@latest generate".

Root cause

@better-auth/api-key@1.5.4 (added in #3969) requires a configId column
in the apikey table, but the Dokploy Drizzle schema (packages/server/src/db/schema/account.ts)
was not updated to include this field.

The drizzle adapter validates all fields it tries to insert against the Drizzle
schema at runtime, and throws if a field is missing.

Fix

Add configId: text("configId") to the apikey table definition + matching migration.

Will you send a PR to fix it?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions