From 4d54eb1fc5b0084f2c1ce3f2c3917e34db2bad95 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Wed, 1 Nov 2023 13:38:37 +0100 Subject: [PATCH 1/3] Renamed 1.27.0 to 1.27.1 migration file to use the same naming scheme as the rest --- .../migrations/{v.1.27.0-v1.27.1 => v1.27.0-v1.27.1}/migrate.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename server/models/migrations/{v.1.27.0-v1.27.1 => v1.27.0-v1.27.1}/migrate.sql (100%) diff --git a/server/models/migrations/v.1.27.0-v1.27.1/migrate.sql b/server/models/migrations/v1.27.0-v1.27.1/migrate.sql similarity index 100% rename from server/models/migrations/v.1.27.0-v1.27.1/migrate.sql rename to server/models/migrations/v1.27.0-v1.27.1/migrate.sql From a2f21e4f9365cb8abe465d307c8d3b3af23bd8a4 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Wed, 1 Nov 2023 13:42:49 +0100 Subject: [PATCH 2/3] Prepare for release 1.29.0 --- server/models/migrations/next/migrate.sql | 47 +------------------ .../migrations/v1.28.0-v1.29.0/migrate.sql | 46 ++++++++++++++++++ 2 files changed, 47 insertions(+), 46 deletions(-) create mode 100644 server/models/migrations/v1.28.0-v1.29.0/migrate.sql diff --git a/server/models/migrations/next/migrate.sql b/server/models/migrations/next/migrate.sql index e80f79f94d..be9887c300 100644 --- a/server/models/migrations/next/migrate.sql +++ b/server/models/migrations/next/migrate.sql @@ -1,46 +1 @@ -/* v1.28.x */ -DELETE FROM role_unit WHERE unit_id = (SELECT id FROM unit WHERE `path` = '/admin/odk-settings'); -DELETE FROM unit WHERE `path` = '/admin/odk-settings'; -DROP TABLE IF EXISTS `odk_central_integration`; - --- remove references to stock_changes report -DELETE FROM role_unit WHERE unit_id = (SELECT id FROM unit WHERE `path` = '/reports/stock_changes'); -DELETE FROM unit WHERE `path` = '/reports/stock_changes'; -DELETE FROM report where `report_key` = 'stock_changes'; - -/** - * @author: lomamech - * @description: Payroll Hospital general model #7000 - * @date: 2023-07-23 - */ -DROP TABLE IF EXISTS `title_employee`; -CREATE TABLE `title_employee` ( - `id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, - `title_txt` VARCHAR(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `title_1` (`title_txt`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 DEFAULT COLLATE = utf8mb4_unicode_ci; - -INSERT IGNORE INTO unit VALUES - (318, 'Job Titles Management','TREE.TITLE','',57, '/titles'); - -CALL add_column_if_missing('employee', 'title_employee_id', 'TINYINT(3) UNSIGNED DEFAULT NULL'); -ALTER TABLE `employee` ADD CONSTRAINT `employee__title_employee` FOREIGN KEY (`title_employee_id`) REFERENCES `title_employee` (`id`); - -CALL add_column_if_missing('enterprise_setting', 'percentage_fixed_bonus', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 100'); - -/** - * @author: lomamech - * @description: Move is_medical property from employee to title #7170 - * @date: 2023-08-25 - */ -ALTER TABLE `employee` DROP COLUMN `is_medical`; -CALL add_column_if_missing('title_employee', 'is_medical', 'TINYINT(1) DEFAULT 0'); - -/** - * author: jniles - * description: enable_external_access allows backup scripts to determine which - * user accounts to leave unlocked. - * date: 2023-10-17 -*/ -CALL add_column_if_missing('user', 'enable_external_access', 'TINYINT(1) NOT NULL DEFAULT 0'); +/* v1.29.0 */ diff --git a/server/models/migrations/v1.28.0-v1.29.0/migrate.sql b/server/models/migrations/v1.28.0-v1.29.0/migrate.sql new file mode 100644 index 0000000000..e80f79f94d --- /dev/null +++ b/server/models/migrations/v1.28.0-v1.29.0/migrate.sql @@ -0,0 +1,46 @@ +/* v1.28.x */ +DELETE FROM role_unit WHERE unit_id = (SELECT id FROM unit WHERE `path` = '/admin/odk-settings'); +DELETE FROM unit WHERE `path` = '/admin/odk-settings'; +DROP TABLE IF EXISTS `odk_central_integration`; + +-- remove references to stock_changes report +DELETE FROM role_unit WHERE unit_id = (SELECT id FROM unit WHERE `path` = '/reports/stock_changes'); +DELETE FROM unit WHERE `path` = '/reports/stock_changes'; +DELETE FROM report where `report_key` = 'stock_changes'; + +/** + * @author: lomamech + * @description: Payroll Hospital general model #7000 + * @date: 2023-07-23 + */ +DROP TABLE IF EXISTS `title_employee`; +CREATE TABLE `title_employee` ( + `id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, + `title_txt` VARCHAR(100) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `title_1` (`title_txt`) +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 DEFAULT COLLATE = utf8mb4_unicode_ci; + +INSERT IGNORE INTO unit VALUES + (318, 'Job Titles Management','TREE.TITLE','',57, '/titles'); + +CALL add_column_if_missing('employee', 'title_employee_id', 'TINYINT(3) UNSIGNED DEFAULT NULL'); +ALTER TABLE `employee` ADD CONSTRAINT `employee__title_employee` FOREIGN KEY (`title_employee_id`) REFERENCES `title_employee` (`id`); + +CALL add_column_if_missing('enterprise_setting', 'percentage_fixed_bonus', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 100'); + +/** + * @author: lomamech + * @description: Move is_medical property from employee to title #7170 + * @date: 2023-08-25 + */ +ALTER TABLE `employee` DROP COLUMN `is_medical`; +CALL add_column_if_missing('title_employee', 'is_medical', 'TINYINT(1) DEFAULT 0'); + +/** + * author: jniles + * description: enable_external_access allows backup scripts to determine which + * user accounts to leave unlocked. + * date: 2023-10-17 +*/ +CALL add_column_if_missing('user', 'enable_external_access', 'TINYINT(1) NOT NULL DEFAULT 0'); From 0a70cb00a43898c26d8bf496fa9c1bb898af4200 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Wed, 1 Nov 2023 14:15:32 +0100 Subject: [PATCH 3/3] Release 1.29.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 104f78ada7..769833ca52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bhima", - "version": "1.28.0", + "version": "1.29.0", "description": "A rural hospital information management system.", "main": "npm run build", "scripts": {