Open Constantine-Ketskalo opened 3 weeks ago
I hear you.
Looks like a lot of work, so I can't say that we can prioritize this without external funding...
I might be extrapolating incorrectly, but this also seems to tie back to being able to upgrade 2sxc Apps also. Which to me is still the single most import ability we need somewhere down the road(map) for 2sxc. :)
Old discussion (RFC: App Upgrading) is here: #2071
I'm submitting a
[x] feature request
...about
[x] Content Types or data management [x] other / unknown
Current Behavior / Expected Behavior
If there are multiple developers for a website and multiple environments, it means that every time we change something in entities structures, views, settings, resources, anything that is saved in the database, it's done only on a PC of a developer that does some task. All the other developers and every environment (PROD, TEST, etc.) need the same changes to be done manually, which is time consuming and makes customer very unhappy regarding time spent by developers.
You could implement code-first approach, similar to Entity Framework. This would allow multiple developers and environments to work independantly and have different actual data on different PCs but keep structure (properties of entities, formulas, and so on) in git.
As other developers mentioned as well at stackoverflow, code-first is a common need for many projects to automate things. Export-import functionality sometimes helps, but it still requires manual work, which might cause someone to forget things or misclick. But if some entity already exists and the need is just to rename/add/delete a property, then export/import won't help.
Some more details and comments from other developers are here: https://stackoverflow.com/q/78702110/7402089
If possible it would be also very useful to implement storage of formulas code somewhere in a file system or at least synchronize those files and database so that formulas keep being tracked by git. Otherwise it's very inconvinient to edit them in browser in a small window or copy-paste it between IDE and browser text input.
Quick first-time solution might involve usage of your library that could be called with correct parameters and then update database. Ideally it would be direct sql scripts, which should work the fastest way.
Also it would be very helpful if you would call this database update implementation on a website start/restart. Optional turning on/off of this automatic DB update, as well as possibility to update database to a certain step in a chain and rolling back changes to certain step back again are also very usefull and helpful things which might be a stopper for many developers in their decision to use or not use 2sxc module at all.
Instructions to Reproduce the Problem
Your environment