Column "createdAt" of relation "account" does not exist #402

Closed
opened 2026-03-13 07:44:32 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @shkumbinhasani on GitHub (Dec 14, 2024).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Initialised Backend with Hono Drizzle Postgress adapter
  2. Initialised Frontend with NextJS
  3. Registration fails with 500 Internal Server Error and log
    column "createdAt" of relation "account" does not exist, I tried adding them manually but got:
    column "token" of relation "session" does not exist. So most of the used columns are not on the migration file

Current vs. Expected behavior

Currently registration fails due to missing columns on the migration file.

I would suggest that in the case of adapets like drizzle, the schema should be exported so that it could be on the same migration as the other drizzle schemas.

What version of Better Auth are you using?

1.0.16

Provide environment information

- os: MacOS

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

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth";
import {pool} from "./db/postgres";

export const auth = betterAuth({
    database: pool,
    basePath: '/auth',
    trustedOrigins: ['http://localhost:48372'],
    emailAndPassword: {
        enabled: true,
    }
})

Additional context

No response

Originally created by @shkumbinhasani on GitHub (Dec 14, 2024). ### Is this suited for github? - [X] Yes, this is suited for github ### To Reproduce 1. Initialised Backend with Hono Drizzle Postgress adapter 2. Initialised Frontend with NextJS 3. Registration fails with 500 Internal Server Error and log column "createdAt" of relation "account" does not exist, I tried adding them manually but got: column "token" of relation "session" does not exist. So most of the used columns are not on the migration file ### Current vs. Expected behavior Currently registration fails due to missing columns on the migration file. I would suggest that in the case of adapets like drizzle, the schema should be exported so that it could be on the same migration as the other drizzle schemas. ### What version of Better Auth are you using? 1.0.16 ### Provide environment information ```bash - os: MacOS ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth"; import {pool} from "./db/postgres"; export const auth = betterAuth({ database: pool, basePath: '/auth', trustedOrigins: ['http://localhost:48372'], emailAndPassword: { enabled: true, } }) ``` ### Additional context _No response_
GiteaMirror added the bug label 2026-03-13 07:44:32 -05:00
Author
Owner

@Bekacru commented on GitHub (Dec 16, 2024):

add createdAt field in your account table. check the docs for the full db schema required by better auth.

@Bekacru commented on GitHub (Dec 16, 2024): add createdAt field in your account table. check the docs for the full db schema required by better auth.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#402