Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I created a table using your guide
https://our.umbraco.com/Documentation/Extending/Database/index-v8
However when I use migrations in normal applications I have up/down methods to seed the data so I don't have to enter it manually.
I don't see any documentation on Umbraco in how I do this? Could anyone advise?
Best
Lq
Hi!
You could seed the data inside your migration. Basically, you could create the table and seed the data in the same migration or separate if you prefer.
Have a look at some examples in the core source code: https://github.com/umbraco/Umbraco-CMS/tree/v9/contrib/src/Umbraco.Infrastructure/Migrations/Upgrade
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to seed data into a new table
Hi
I created a table using your guide
https://our.umbraco.com/Documentation/Extending/Database/index-v8
However when I use migrations in normal applications I have up/down methods to seed the data so I don't have to enter it manually.
I don't see any documentation on Umbraco in how I do this? Could anyone advise?
Best
Lq
Hi!
You could seed the data inside your migration. Basically, you could create the table and seed the data in the same migration or separate if you prefer.
Have a look at some examples in the core source code: https://github.com/umbraco/Umbraco-CMS/tree/v9/contrib/src/Umbraco.Infrastructure/Migrations/Upgrade
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.