====== General Guidelines ====== ===== SQL Upgrade and Rollback Scripts ===== To ensure extra smoothness of the releases, the domain-related changes to the database (any application) must be accompanied by the relevant **UPGRADE** and **ROLLBACK** scripts. These scripts can be found in the [[https://bitbucket.org/errigal/idms-sql-script/|idms-sql-script]] repository in the **upgrade** directory under the relevant release (e.g. 3.2.5 (patches included)) folder. Please do not forget to include the database-change-related ticket number as a comment in the **UPGRADE** and **ROLLBACK** scripts and in the GIT commit. Example: You have added the **abbreviation** String field to the **state** entity in the **SnmpManager** in the **REL-3.3.7**. Following steps: - clone or pull the **idms-sql-script** repository - **cd** to the **upgrade** folder - **cd** to the **3.3.7** folder (the relevant release folder) (create one if it does not exist) - **cd** to the **snmp_manager** folder (create one if it does not exist) - open the file with the name similar to **1-1.SnmpManager_3_3_0_upgrade.sql** (create one if it does not exist) - in it, add the comment stating the related changes ticket number - in it, add the following line modifying the **state** table to add the **abbreviation** varchar column: **ALTER TABLE state ADD COLUMN abbreviation VARCHAR(255) NULL AFTER region_id, ADD UNIQUE INDEX abbreviation_UNIQUE (abbreviation ASC);** - commit - push The steps for the **ROLLBACK** script are similar, with the only difference being the changed scripts and the column being dropped instead of created.