Use as framework - initial migration with setting update. #2423
Unanswered
hanming2033
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Thanks. I wasn't able to reproduce it initially, but I forgot that I wasn't working with blank I've added in |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi pocketbase,
Thank you making such a nice product. I am trying to have migration script that configures pocketbase on initial setup.
In the docs, https://pocketbase.io/docs/migrations/, it says that we can get the Settings by using the code below.
The problem is that the settings(default) is only persisted to DB after the initial migration scripts are run. So, the above code will fail if used as initial migration script.
To get around it, I used the New func to instantiate the default settings. The good thing is that, once default settings are set in migration script, pocketbase will not try to set it again.
My 2 cents:
Beta Was this translation helpful? Give feedback.
All reactions