Yesterday, I created infrastructure to customize and run Balance sheet, P&L, trial balance and "generic list" reports (in their downloadable versions) on a per-company basis. To support this use-case, they will need to be uploaded to the database, just like the invoice, order and other templates.
For our code base, it's an either/or situation that we support the in-database templates (or remain with the ones on-disk). Personally, I see benefits in moving to the in-database templates, mostly because they then become customizable by end users with sufficient rights, not just system admins.
Now, I'm looking for a suitable way to make the switch for everybody who already has a pre-1.8 system running when we release this functionality with 1.8. I see several options to get templates into their databases:
1. Create an SQL database upgrade script with the templates embedded
This has the benefit that the templates will be there after the database is upgraded. However, when the templates change over time, the script can't be updated to include the updated templates, because that's the way our SQL schema change management works.
2. Do nothing, but fail with an error about the import needing to happen when the templates are missing upon output generation
This is probably the easiest way to go by, but the error might end up with users who won't be able to address the issue themselves.
3. Create new infrastructure to test "company configuration sanity" which can be run from setup.pl
at the end of the migration
This solution is a lot of additional work, but can be used to indicate configuration and database health issues to admins after upgrades. One such issue would be that the templates are missing. This functionality can be used independently from upgrades as well and would address the issue that we have wanted to land database integrity/sanity checks (but didn't have anywhere to do so).
Comments? Other ideas?
Robust and Flexible. No vendor lock-in.