upgrade_db is a tool for upgrading Emdros databases created with Emdros version 1.1.7 or earlier to databases that work with Emdros version 1.1.8 and later.
For databases created with Emdros prior to version 1.1.0, the program
does the following: For each object type OT in the database, it:
1) Adds a new column, is_first, to the OT_monad_ms table.
2) Adds some indices on OT_monad_ms and OT_objects (see EMdFDB::createIndicesOnOTObjects and EMdFDB::CreateIndicesOnOTMonadMs).
3) If using PostgreSQL, sets all is_first values in OT_monad_ms to 'N'.
4) Finds out which is_first values should be set to 'Y'.
5) Sets these to 'Y'. Each dot represents 500 rows.
6) Drops table OT_monad_ds.
After having dealt with all object types, the program creates two new tables, `sequence_0' and `sequence_1', and moves the values from the old `sequences' table into these new tables. It then drops the old `sequences' table.
For databases created with Emdros versions 1.1.0 to 1.1.4, the program does the following:
1) Creates the table max_m
2) Sets the values in this table to the maximum monad found in the database.
For databases created with Emdros versions 1.1.5 to 1.1.7, the program does the following:
1) Creates the tables/sequences sequence_118_0 and sequence_118_1 (tables on MySQL, sequences on PostgreSQL).
2) Moves the values from the old sequence_0 and sequence_1 tables to the new tables/sequences.
3) Drops the old sequence_0 and sequence_1 tables.
See the source in EMdF/emdfdb.cpp:EMdFDB::upgradeDatabase for the full story.