[GH-ISSUE #455] Question: how to create nullable field in schema when database already exists ? #16909

Closed
opened 2026-04-15 14:52:49 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @MrKepzie on GitHub (Nov 7, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/455

Describe the bug
Adding a new field to my plug-in schema.
After running cli migrate, I get:
error: column "last_api_login" of relation "user" contains null values

I tested input:false, defaultValue:"" etc... but none worked. What's the appropriate way ?

Thank you

Originally created by @MrKepzie on GitHub (Nov 7, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/455 **Describe the bug** Adding a new field to my plug-in schema. After running cli migrate, I get: `error: column "last_api_login" of relation "user" contains null values` I tested input:false, defaultValue:"" etc... but none worked. What's the appropriate way ? Thank you
GiteaMirror added the locked label 2026-04-15 14:52:49 -05:00
Author
Owner

@MrKepzie commented on GitHub (Nov 8, 2024):

Well turned out I had to add required: false, which I assumed was the default

<!-- gh-comment-id:2464525469 --> @MrKepzie commented on GitHub (Nov 8, 2024): Well turned out I had to add required: false, which I assumed was the default
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#16909