Closed dhymik closed 4 years ago
But Models Builder is a "code after" solution, it auto generates files based on doc types in the database, so the source is the database, and the corresponding autogenerated .cs files should not be under source control, or should they actually?
Any querying in templates will fail until the files are regenerated.
a database dump would need to be created and source controlled. This is the only way to source control doc types, and doc types, in turn, control the auto generated models files.
For v8 we don't have the Umbraco Deploy product on premise yet, but that would be another way. There's other plugins that can facilitate this as well.
Ultimately, there's loads of room for discussion on this, but the docs describe how we think you should work and of course people deviate from this all the time, which is great!
This is the page with issues: https://github.com/umbraco/UmbracoDocs/edit/master/Getting-Started/Code/Source-Control/index.md
In the
App_Data
section,Models Builder
sub section, of theSource Control
page, it says:And further down, in the
Controllers/Classes/Custom Code
section, it says:But Models Builder is a "code after" solution, it auto generates files based on doc types in the database, so the source is the database, and the corresponding autogenerated .cs files should not be under source control, or should they actually? Afaik, only developer generated partial class files (extending the auto generated models) should be included in source control.
In the
DocumentType - Backoffice Structure Changes
section further down, it is explained that changes to doc types are stored in the database, so in order to track those changes, a database dump would need to be created and source controlled. This is the only way to source control doc types, and doc types, in turn, control the auto generated models files.What do you think?