Question: how to create nullable field in schema when database already exists ? #194

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

Originally created by @MrKepzie on GitHub (Nov 7, 2024).

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). **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
Author
Owner

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

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

@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#194