Strategy for parallel development/production

I am using the platform to develop a custom ERP/MRP system for my company. This single system is replacing many smaller MS Access databases, spreadsheets, physical record keeping, and tribal knowledge. Because of the inherent weaknesses and shortcomings in trying to maintain their processes across the many old datastores, the company has opted for me to complete some of their processes initially, deploy those processes into production so they can take advantage of using a single database, and then continue adding on other processes to the application so as to have parallel production/development. So I, of course, intend to create a development database to test on and a production database but I’m unsure of all of the specifics of how to accomplish this using the platform.

I know from here that CUBA can be configured to execute database scripts whenever the server is started. Can I take this to mean that if I were to buildWar and deploy that WAR to the production server that the platform will check that the data model of the WAR matches the schema of the database?

Also, whenever I buildWar to compile the new WAR for the production server, is there an easy way to specify the database connection for the production database rather than the development database?

This is not quite correct. The server doesn’t compare your data model with the database schema, it just executes all SQL scripts available in the application that are not yet executed on the database (and registered in SYS_DB_CHANGELOG table). The scripts must be created beforehand and stored in modules/core/db/update directory of your project. The build tasks will pack them to WAR or uberJAR. Usually, you create the scripts automatically when developing with Studio.

Sure. Click Generate button next to Custom context.xml field, and Studio will show a dialog where you can enter your production database connection settings. These settings will be used for the WAR file.
image

1 Like