Replies: 1 comment
-
|
Thanks for reporting. The model definition uses I verified this by testing the registration + seed flow — the notification channel is correctly created with Possible cause: If your PostgreSQL database was initially created with an older version of Bonds (or manually), GORM AutoMigrate may not have corrected the column type from a previous schema. AutoMigrate adds missing columns but does not change existing column types. Fix: Run this SQL manually against your database: ALTER TABLE user_notification_channels
ALTER COLUMN preferred_time TYPE time
USING preferred_time::time;This is the same fix you already found. For fresh PostgreSQL installations, this should not be an issue since the current schema definition is correct. If you can reproduce this on a fresh database (no prior schema), please let me know the GORM and PostgreSQL driver versions — that would indicate a driver-level bug. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m running Bonds with PostgreSQL and encountered a registration error.
When creating a new account, the API returns 500 / “Failed to register”.
The log shows the issue occurs when inserting into user_notification_channels:
INSERT INTO "user_notification_channels" ("user_id","channel_type","enabled","preferred_time","created_at","updated_at") VALUES (...,'email',true,'09:00',...)But the table schema created by Bonds is:
preferred_time timestamptzPostgreSQL rejects '09:00' for a timestamp with time zone.
Manually changing the column to time fixes the issue:
ALTER TABLE user_notification_channels ALTER COLUMN preferred_time TYPE time USING preferred_time::time;After this change, registration works normally.
So it looks like the schema should use time instead of timestamptz for preferred_time.
Beta Was this translation helpful? Give feedback.
All reactions