This is Queweb core database scripts directory.

Database Versioning
~~~~~~~~~~~~~~~~~~~~
The applications database is versioned with 3-digit version numbers which look like v001, v002, etc.
The version number is incremented any time when one of the following changes take place:
1. Schema changes (tables, views, stored procedures, triggers, etc.)
2. Changes of read-only tables (application's system tables, like roles, countries, etc.) i.e. tables
    that are not modified via the user interface or have some default content.

Scripts Organisation
~~~~~~~~~~~~~~~~~~~~
    [rdbms] -- directory for particular relational database management system (for ex., Oracle, MS SQL, etc.)
        *_vXXX.sql -- database create scripts (used when creating database from scratch)
        updates -- directory for update scripts (used when updating existing database to the next version)
            vXXX_to_vYYY.sql -- update scripts from version XXX to version YYY
    version.properties -- the properties file with the value of latest database version
    readme.txt -- this file

Database Change Order
~~~~~~~~~~~~~~~~~~~~~
When developers do changes to the database that lead to increasing of version number, the following
steps must take place:
1. For all [rdbms] directories, all *_vXXX.sql files are identified that need changes
2. All those files are renamed to *_vYYY.sql (renamed, not copied) with "svn rename" command to preserve 
the files' history. Here YYY is the next version number after XXX
3. All renamed files are modified as appropriate
4. In each [rdbms]/updates directory one (exactly) file is created named vXXX_to_vYYY.sql which contains
all changes needed to upgrade existing databases from version XXX to version YYY
5. The file version.properties must be modified and the new version number YYY specified in place of XXX
6. In all [rdbms]/update directories the file vXXX_to_vYYY.sql must contain the following query as 
the last statement (of course the new version number must be specified in place of YYY):
    UPDATE QX_SYS_PROP SET PROP_VAL = 'YYY' WHERE (PROP_ID = 'DB_CORE_VERSION')
7. In all [rdbms] directories the file 3.framework-data_vXXX.sql must be renamed (similarly to step 2) 
to 3.framework-data_vYYY.sql and the following query in it must be amended:
    insert into QX_SYS_PROP (PROP_ID, PROP_VAL, DESCRIPTION) values ('DB_CORE_VERSION', 'XXX', 'Core database version. Do not modify');
to contain 'YYY' instead of 'XXX'

Note that after step 2 the files *_vXXX.sql over time can become a set of files with different version
numbers. It is a normal situation and the highest version number will indicate the version numbers of the
whole database.
