The sql scripts needed to create tables on database would be numbered and stored in repository. And each change in data model would generate modification sql scripts automatically. The scripts from one application version to another are just those numbered scripts from one number to another. As result, first version of DRIVER table should generate 0001.DRIVER.SQL (with create table...). If we add a new field into data model, next generation should give a new file 0002.DRIVER.SQL with: - create table temp_DRIVER as select... - drop table DRIVER - create table DRIVER... - insert into DRIVER as select... - drop table temp_DRIVER Or something so simple as - alter table DRIVER depending on nature of datamodel change. But I think Uniface should be intelligent enoguh to give us this sort of scripts.
-Developer launches Utilities->Deployment->SQL Table -Let developer choose database, model and tables -For each table, check if a previous script was generated - If so, look up the generation date and compare it with entity definition history. - Modifications only add at the end or remove a field. Script should be an ALTER TABLE - Modifications are more complex. Script should be a normal sql script with a pre-script and a post-script - pre-script = drop table temporal, create temporal table as select * from table - post-script = insert into table as select ... from temporal - Whole script is generated, numbered with next number in sequence and recorded in repository. As option, script itself is stored in repository as code and could be included in UAR files.
It is useful for Configuration Management. As your versions are numbered you can store which numbered SQL scripts belong to this version. Evolve a database model from one version to next one is as simple as launch all these sql scripts in order. New installation -> all scripts Upgrade installation -> from last sql script associated with installed version
Uniface Development Environment