-
Notifications
You must be signed in to change notification settings - Fork 376
Description
I added a Boolean field "authorized" in the User table defined in "config/models" using a clean scaffolded site.
-- snip --
User
ident Text
password Text Maybe
authorized Bool default=True
UniqueUser ident
-- snip --
As expected, upon next startup of the development server, yesod migrates the table correctly:
Starting devel application
Devel application launched: http://localhost:3000
Migrating: ALTER TABLE "user" ADD COLUMN "authorized" BOOLEAN NOT NULL DEFAULT True
However, when the development server is launched for the second time, it sets the default value again even if it has not been changed:
Starting devel application
Devel application launched: http://localhost:3000
Migrating: ALTER TABLE "user" ALTER COLUMN "authorized" SET DEFAULT True
Is this intended behavior? Is it not possible to retrieve the default value from the database, so yesod takes a conservative approach and rewrites the default value every time?