Skip to main content

When I create a new model in the SF (2024.2), vrs_control_branch_id and vrs_control_model_vrs_id of the main branch will be empty (and stay empty after generating definitions) (screenshot 1). When I develop something in the model and then try to upgrade the database, no ‘upgrade’ script will be generated at the ‘creation - execute source code’ tab (screenshot 2). 

Am I missing something here?

After setting vrs_control_branch_id and vrs_control_model_vrs_id in the database of the SF, it does work correctly.

 

 

 

 

Hi Peter,

When creating a new model, that normally means you also don't have a database to upgrade yet. So the Creation process is streamlined to get you a new database to start. After deploying once, you'll have a database to upgrade. The model version should be filled after the Execution of source code. The code that does this checks if the DB or the Upgrade code file was successfully executed.

You can set the Source branch and Source model version by updating the source version via the Data migration screen. If your runtime configuration is looking at the restored database, the model version will be extracted and used.


I manually created a new (empty) database and made the Indicium pool user database owner because the Indicium pool user doesn't have permission to create a database on the server. 

Maybe this could be improved by letting the SF create a model_vrs and set this as source upon creation of a new model?


Reason before it was DB and Upgrade was because for Oracle and DB2 we only had a DB script and no Create script. Now we do have it so i'll change it so the source version is updated when either the Create or dthe Upgrade script succeds. That also resolves it for you as only the DB step is skipped in your case.

The Execute source code process does verify whether or not the database exists. If it does, it checks the table for sf_model_info, and if that does not exist the Create script will be run.

The model version will already be created during the Generate definition process. That is also the model version that will be deployed to the database. 

Edit, changed in 2024.3. Now the Version control will be updated after a successful Create or Upgrade.


@PeterKeeris I stumbled on the same issue when I did create a new Model after many years only developing on existing products.

After have it run once and it creating a database, it would never see the next creation as an upgrade. Those fields where indeed empty. It did get it to work after running “Generate data migration” in the “Data migration” window, even tough I had no data model changes, but that at least filled the fields got creation to create an upgrade script (or detected it properly).

Experience is on 2023.3.