Make DocumentTypes and DataTypes code-first instead of database-first #13636
Nikkelmann
started this conversation in
Features and ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As Umbraco is built right now, the project is a mix between compiled code and dynamic code stored in the database.
All the different types under the settings tab is stored in the database, instead of being actual code in the project.
This means that the project will not work without the database that the project was build on.
When we as developers have to create a new instance of a Umbraco website, we have to basically have to recreate it from scratch, instead of deploying a new instance of our own Umbraco project.
I would argue, that the only thing that should actually be in the database, should be the content of the website that is being run.
This way the project will still work if the database is changed; it will just not have any content (aka a fresh website ready to use).
The way this issue is solved right now is by being dependent on an external package (uSync), to store the types as xml in the project and import it on runtime.
Changing to code-first does not mean loosing the abillity to create the types from the backoffice - afterall this is, in a way, no different than the generated published models.
Backwards compatibilty with existing projects could be handled by migrating the types stored in the database to code.
It would also solve most of the issues of these discussions:
#11854
#13319
The following types from settings should be in the code instead of in the database:
Languages however are a bit weird - they are more related to the content, but are stored as settings, but I digress, this is a different topic.
Beta Was this translation helpful? Give feedback.
All reactions