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
When creating custom tables in the Umbraco DB, is it best to do this in the web project, or the core project?
I can see arguments either way, but am curious if the community is leaning one way or another.
Thanks!
Since you mention a Core and Web project, are you doing this on Umbraco Cloud?
In either case, I blogged about this: https://cultiv.nl/blog/using-umbraco-migrations-to-deploy-changes/
Do check out Shannon's comment at the bottom though and have a look at how we write those migrations in Umbraco's core: https://github.com/umbraco/Umbraco-CMS/tree/dev-v7/src/Umbraco.Core/Persistence/Migrations/Upgrades
For example, here's one for adding a new table: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/AddRedirectUrlTable.cs
Thanks for the resources they have come in handy. Yes this is for Umbraco Cloud, but now that I think about it, I suppose it's an anti-pattern to build this up in the Web project.
The migration guide is unbelievably helpful!
Ah yes, I forgot to say, make sure to do all your C# coding in the .Core project :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Custom Table Best Practices
When creating custom tables in the Umbraco DB, is it best to do this in the web project, or the core project?
I can see arguments either way, but am curious if the community is leaning one way or another.
Thanks!
Since you mention a Core and Web project, are you doing this on Umbraco Cloud?
In either case, I blogged about this: https://cultiv.nl/blog/using-umbraco-migrations-to-deploy-changes/
Do check out Shannon's comment at the bottom though and have a look at how we write those migrations in Umbraco's core: https://github.com/umbraco/Umbraco-CMS/tree/dev-v7/src/Umbraco.Core/Persistence/Migrations/Upgrades
For example, here's one for adding a new table: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/AddRedirectUrlTable.cs
Thanks for the resources they have come in handy. Yes this is for Umbraco Cloud, but now that I think about it, I suppose it's an anti-pattern to build this up in the Web project.
The migration guide is unbelievably helpful!
Ah yes, I forgot to say, make sure to do all your C# coding in the .Core project :-)
is working on a reply...