From 99cbd9425aec5ef652525b191d38a2407d8e6cd4 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Fri, 12 Dec 2025 16:40:24 +0530 Subject: [PATCH 01/17] Dynamic Form for db changes --- .../dbiemr/V31__AMM_1877_DB_IEMR.sql | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/main/resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql diff --git a/src/main/resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql new file mode 100644 index 00000000..96e1c216 --- /dev/null +++ b/src/main/resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql @@ -0,0 +1,74 @@ +-- ======================================== +-- Migration: Create New Tables +-- ======================================== +USE db_iemr; + +------------------------------------------------------------- +-- form_module +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `form_module` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `module_name` varchar(255) NOT NULL, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +------------------------------------------------------------- +-- form_master +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `form_master` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `form_id` varchar(100) NOT NULL, + `form_name` varchar(255) NOT NULL, + `module_id` bigint DEFAULT NULL, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `version` int DEFAULT 1, + PRIMARY KEY (`id`), + UNIQUE KEY (`form_id`), + KEY `fk_module` (`module_id`), + CONSTRAINT `fk_module` FOREIGN KEY (`module_id`) REFERENCES `form_module` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +------------------------------------------------------------- +-- form_fields +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `form_fields` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `form_id` varchar(100) NOT NULL, + `section_title` varchar(255), + `field_id` varchar(100) NOT NULL, + `label` varchar(255), + `type` varchar(100), + `is_required` tinyint(1), + `default_value` varchar(255), + `placeholder` varchar(255), + `options` longtext, + `validation` longtext, + `conditional` longtext, + `sequence` int, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `is_visible` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`), + KEY `fk_form` (`form_id`), + CONSTRAINT `fk_form` FOREIGN KEY (`form_id`) REFERENCES `form_master` (`form_id`) ON DELETE CASCADE, + CONSTRAINT `form_fields_chk_1` CHECK (json_valid(`options`)), + CONSTRAINT `form_fields_chk_2` CHECK (json_valid(`validation`)), + CONSTRAINT `form_fields_chk_3` CHECK (json_valid(`conditional`)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +------------------------------------------------------------- +-- m_translation +------------------------------------------------------------- +CREATE TABLE `m_translation` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `label_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `english` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , + `hindi_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , + `is_active` tinyint(1) NOT NULL, + `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `assamese_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `label_key` (`label_key`) + ) ENGINE=InnoDB AUTO_INCREMENT=452 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; From 32f364254874f12d25f2acd6ed91b96b1f22f008 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Fri, 12 Dec 2025 16:42:18 +0530 Subject: [PATCH 02/17] Dynamic Form for db changes --- .../resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql index 96e1c216..9e87604b 100644 --- a/src/main/resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql +++ b/src/main/resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql @@ -59,7 +59,7 @@ CREATE TABLE IF NOT EXISTS `form_fields` ( ------------------------------------------------------------- -- m_translation ------------------------------------------------------------- -CREATE TABLE `m_translation` ( +CREATE TABLE IF NOT EXISTS `m_translation` ( `id` bigint NOT NULL AUTO_INCREMENT, `label_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `english` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , From aa048ce58967960a11a530385c5315a37f74f2cc Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Fri, 12 Dec 2025 16:53:28 +0530 Subject: [PATCH 03/17] Dynamic Form for db changes --- .../{V31__AMM_1877_DB_IEMR.sql => V29__AMM_1877_DB_IEMR.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/db/migration/dbiemr/{V31__AMM_1877_DB_IEMR.sql => V29__AMM_1877_DB_IEMR.sql} (100%) diff --git a/src/main/resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql similarity index 100% rename from src/main/resources/db/migration/dbiemr/V31__AMM_1877_DB_IEMR.sql rename to src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql From 1f84119c9e332d828d255395efdec52ef2cebe71 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Fri, 12 Dec 2025 17:33:08 +0530 Subject: [PATCH 04/17] Dynamic Form for db changes --- .../resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql index 9e87604b..86687289 100644 --- a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql +++ b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql @@ -8,7 +8,7 @@ USE db_iemr; ------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `form_module` ( `id` bigint NOT NULL AUTO_INCREMENT, - `module_name` varchar(255) NOT NULL, + `module_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; From dbec5e57732bf7527b8dd014ca37429e1164c1b7 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Fri, 12 Dec 2025 17:34:12 +0530 Subject: [PATCH 05/17] Dynamic Form for db changes --- .../resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql index 86687289..07173601 100644 --- a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql +++ b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql @@ -64,7 +64,7 @@ CREATE TABLE IF NOT EXISTS `m_translation` ( `label_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `english` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , `hindi_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , - `is_active` tinyint(1) NOT NULL, + `is_active` tinyint(1) NOT NULL DEFAULT 1, `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `updated_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, From 80f8a02f5c3265c3943667114f00fc8c670b2ff2 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Fri, 12 Dec 2025 17:35:09 +0530 Subject: [PATCH 06/17] Dynamic Form for db changes --- .../resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql index 07173601..888e58cb 100644 --- a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql +++ b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS `form_module` ( `module_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ------------------------------------------------------------- -- form_master From ec49166defbf184d69c2dfb0fe85f412e23451b3 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Mon, 5 Jan 2026 15:33:49 +0530 Subject: [PATCH 07/17] soft-delete AMM-2040,AMM-2060 --- .../dbidentity/V7__add_soft_delete_db_identity.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/main/resources/db/migration/dbidentity/V7__add_soft_delete_db_identity.sql diff --git a/src/main/resources/db/migration/dbidentity/V7__add_soft_delete_db_identity.sql b/src/main/resources/db/migration/dbidentity/V7__add_soft_delete_db_identity.sql new file mode 100644 index 00000000..d333977d --- /dev/null +++ b/src/main/resources/db/migration/dbidentity/V7__add_soft_delete_db_identity.sql @@ -0,0 +1,11 @@ +-- ======================================== +-- Migration: ADD NEW COLUMN +-- ======================================== + +ALTER TABLE db_identity.i_beneficiarydetails_rmnch +ADD COLUMN IF NOT EXISTS isDeactivate BOOLEAN DEFAULT FALSE; + +ALTER TABLE db_identity.i_householddetails +ADD COLUMN IF NOT EXISTS isDeactivate BOOLEAN DEFAULT FALSE; + + From f05d3977db1241091019491ee920b118aeaca3fd Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Mon, 5 Jan 2026 15:37:12 +0530 Subject: [PATCH 08/17] soft-delete AMM-2040,AMM-2060 --- .../dbiemr/V29__AMM_1877_DB_IEMR.sql | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql diff --git a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql deleted file mode 100644 index 888e58cb..00000000 --- a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql +++ /dev/null @@ -1,74 +0,0 @@ --- ======================================== --- Migration: Create New Tables --- ======================================== -USE db_iemr; - -------------------------------------------------------------- --- form_module -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `form_module` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `module_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` datetime DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -------------------------------------------------------------- --- form_master -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `form_master` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `form_id` varchar(100) NOT NULL, - `form_name` varchar(255) NOT NULL, - `module_id` bigint DEFAULT NULL, - `created_at` datetime DEFAULT CURRENT_TIMESTAMP, - `version` int DEFAULT 1, - PRIMARY KEY (`id`), - UNIQUE KEY (`form_id`), - KEY `fk_module` (`module_id`), - CONSTRAINT `fk_module` FOREIGN KEY (`module_id`) REFERENCES `form_module` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -------------------------------------------------------------- --- form_fields -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `form_fields` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `form_id` varchar(100) NOT NULL, - `section_title` varchar(255), - `field_id` varchar(100) NOT NULL, - `label` varchar(255), - `type` varchar(100), - `is_required` tinyint(1), - `default_value` varchar(255), - `placeholder` varchar(255), - `options` longtext, - `validation` longtext, - `conditional` longtext, - `sequence` int, - `created_at` datetime DEFAULT CURRENT_TIMESTAMP, - `is_visible` tinyint(1) DEFAULT 0, - PRIMARY KEY (`id`), - KEY `fk_form` (`form_id`), - CONSTRAINT `fk_form` FOREIGN KEY (`form_id`) REFERENCES `form_master` (`form_id`) ON DELETE CASCADE, - CONSTRAINT `form_fields_chk_1` CHECK (json_valid(`options`)), - CONSTRAINT `form_fields_chk_2` CHECK (json_valid(`validation`)), - CONSTRAINT `form_fields_chk_3` CHECK (json_valid(`conditional`)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -------------------------------------------------------------- --- m_translation -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `m_translation` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `label_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `english` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , - `hindi_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , - `is_active` tinyint(1) NOT NULL DEFAULT 1, - `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `updated_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `assamese_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `label_key` (`label_key`) - ) ENGINE=InnoDB AUTO_INCREMENT=452 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; From 0e13f5313a85cc5dd093eeacd249cf51e79fc068 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Mon, 5 Jan 2026 15:38:19 +0530 Subject: [PATCH 09/17] dynamic form tables AMM-1877 --- .../dbiemr/V29__AMM_1877_DB_IEMR.sql | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql diff --git a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql new file mode 100644 index 00000000..888e58cb --- /dev/null +++ b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql @@ -0,0 +1,74 @@ +-- ======================================== +-- Migration: Create New Tables +-- ======================================== +USE db_iemr; + +------------------------------------------------------------- +-- form_module +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `form_module` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `module_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +------------------------------------------------------------- +-- form_master +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `form_master` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `form_id` varchar(100) NOT NULL, + `form_name` varchar(255) NOT NULL, + `module_id` bigint DEFAULT NULL, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `version` int DEFAULT 1, + PRIMARY KEY (`id`), + UNIQUE KEY (`form_id`), + KEY `fk_module` (`module_id`), + CONSTRAINT `fk_module` FOREIGN KEY (`module_id`) REFERENCES `form_module` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +------------------------------------------------------------- +-- form_fields +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `form_fields` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `form_id` varchar(100) NOT NULL, + `section_title` varchar(255), + `field_id` varchar(100) NOT NULL, + `label` varchar(255), + `type` varchar(100), + `is_required` tinyint(1), + `default_value` varchar(255), + `placeholder` varchar(255), + `options` longtext, + `validation` longtext, + `conditional` longtext, + `sequence` int, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `is_visible` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`), + KEY `fk_form` (`form_id`), + CONSTRAINT `fk_form` FOREIGN KEY (`form_id`) REFERENCES `form_master` (`form_id`) ON DELETE CASCADE, + CONSTRAINT `form_fields_chk_1` CHECK (json_valid(`options`)), + CONSTRAINT `form_fields_chk_2` CHECK (json_valid(`validation`)), + CONSTRAINT `form_fields_chk_3` CHECK (json_valid(`conditional`)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +------------------------------------------------------------- +-- m_translation +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `m_translation` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `label_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `english` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , + `hindi_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , + `is_active` tinyint(1) NOT NULL DEFAULT 1, + `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `assamese_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `label_key` (`label_key`) + ) ENGINE=InnoDB AUTO_INCREMENT=452 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; From 47067837e4cd199bc27a8ccb67c37f067154a274 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Mon, 5 Jan 2026 15:39:31 +0530 Subject: [PATCH 10/17] soft-delete AMM-2040,AMM-2060 --- .../dbiemr/V29__AMM_1877_DB_IEMR.sql | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql diff --git a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql deleted file mode 100644 index 888e58cb..00000000 --- a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql +++ /dev/null @@ -1,74 +0,0 @@ --- ======================================== --- Migration: Create New Tables --- ======================================== -USE db_iemr; - -------------------------------------------------------------- --- form_module -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `form_module` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `module_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` datetime DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -------------------------------------------------------------- --- form_master -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `form_master` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `form_id` varchar(100) NOT NULL, - `form_name` varchar(255) NOT NULL, - `module_id` bigint DEFAULT NULL, - `created_at` datetime DEFAULT CURRENT_TIMESTAMP, - `version` int DEFAULT 1, - PRIMARY KEY (`id`), - UNIQUE KEY (`form_id`), - KEY `fk_module` (`module_id`), - CONSTRAINT `fk_module` FOREIGN KEY (`module_id`) REFERENCES `form_module` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -------------------------------------------------------------- --- form_fields -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `form_fields` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `form_id` varchar(100) NOT NULL, - `section_title` varchar(255), - `field_id` varchar(100) NOT NULL, - `label` varchar(255), - `type` varchar(100), - `is_required` tinyint(1), - `default_value` varchar(255), - `placeholder` varchar(255), - `options` longtext, - `validation` longtext, - `conditional` longtext, - `sequence` int, - `created_at` datetime DEFAULT CURRENT_TIMESTAMP, - `is_visible` tinyint(1) DEFAULT 0, - PRIMARY KEY (`id`), - KEY `fk_form` (`form_id`), - CONSTRAINT `fk_form` FOREIGN KEY (`form_id`) REFERENCES `form_master` (`form_id`) ON DELETE CASCADE, - CONSTRAINT `form_fields_chk_1` CHECK (json_valid(`options`)), - CONSTRAINT `form_fields_chk_2` CHECK (json_valid(`validation`)), - CONSTRAINT `form_fields_chk_3` CHECK (json_valid(`conditional`)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -------------------------------------------------------------- --- m_translation -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `m_translation` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `label_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `english` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , - `hindi_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , - `is_active` tinyint(1) NOT NULL DEFAULT 1, - `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `updated_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `assamese_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `label_key` (`label_key`) - ) ENGINE=InnoDB AUTO_INCREMENT=452 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; From fa9b21e89b691623cc29b0bd1e23071841c36359 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Mon, 5 Jan 2026 15:40:23 +0530 Subject: [PATCH 11/17] dynamic form tables AMM-1877 --- .../dbiemr/V29__AMM_1877_DB_IEMR.sql | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql diff --git a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql new file mode 100644 index 00000000..888e58cb --- /dev/null +++ b/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql @@ -0,0 +1,74 @@ +-- ======================================== +-- Migration: Create New Tables +-- ======================================== +USE db_iemr; + +------------------------------------------------------------- +-- form_module +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `form_module` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `module_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +------------------------------------------------------------- +-- form_master +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `form_master` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `form_id` varchar(100) NOT NULL, + `form_name` varchar(255) NOT NULL, + `module_id` bigint DEFAULT NULL, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `version` int DEFAULT 1, + PRIMARY KEY (`id`), + UNIQUE KEY (`form_id`), + KEY `fk_module` (`module_id`), + CONSTRAINT `fk_module` FOREIGN KEY (`module_id`) REFERENCES `form_module` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +------------------------------------------------------------- +-- form_fields +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `form_fields` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `form_id` varchar(100) NOT NULL, + `section_title` varchar(255), + `field_id` varchar(100) NOT NULL, + `label` varchar(255), + `type` varchar(100), + `is_required` tinyint(1), + `default_value` varchar(255), + `placeholder` varchar(255), + `options` longtext, + `validation` longtext, + `conditional` longtext, + `sequence` int, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `is_visible` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`), + KEY `fk_form` (`form_id`), + CONSTRAINT `fk_form` FOREIGN KEY (`form_id`) REFERENCES `form_master` (`form_id`) ON DELETE CASCADE, + CONSTRAINT `form_fields_chk_1` CHECK (json_valid(`options`)), + CONSTRAINT `form_fields_chk_2` CHECK (json_valid(`validation`)), + CONSTRAINT `form_fields_chk_3` CHECK (json_valid(`conditional`)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +------------------------------------------------------------- +-- m_translation +------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `m_translation` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `label_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `english` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , + `hindi_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , + `is_active` tinyint(1) NOT NULL DEFAULT 1, + `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `assamese_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `label_key` (`label_key`) + ) ENGINE=InnoDB AUTO_INCREMENT=452 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; From 2f208bc465d8f42961c4c2c2b9dd09c1ffa5ab31 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Mon, 5 Jan 2026 15:41:36 +0530 Subject: [PATCH 12/17] dynamic form tables AMM-1877 --- .../dbidentity/V7__add_soft_delete_db_identity.sql | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 src/main/resources/db/migration/dbidentity/V7__add_soft_delete_db_identity.sql diff --git a/src/main/resources/db/migration/dbidentity/V7__add_soft_delete_db_identity.sql b/src/main/resources/db/migration/dbidentity/V7__add_soft_delete_db_identity.sql deleted file mode 100644 index d333977d..00000000 --- a/src/main/resources/db/migration/dbidentity/V7__add_soft_delete_db_identity.sql +++ /dev/null @@ -1,11 +0,0 @@ --- ======================================== --- Migration: ADD NEW COLUMN --- ======================================== - -ALTER TABLE db_identity.i_beneficiarydetails_rmnch -ADD COLUMN IF NOT EXISTS isDeactivate BOOLEAN DEFAULT FALSE; - -ALTER TABLE db_identity.i_householddetails -ADD COLUMN IF NOT EXISTS isDeactivate BOOLEAN DEFAULT FALSE; - - From 0c3719a05ad0bd3f064c32f91b07f4daa71e28b9 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Mon, 5 Jan 2026 15:43:07 +0530 Subject: [PATCH 13/17] dynamic form tables AMM-1877 --- .../{V29__AMM_1877_DB_IEMR.sql => V33__AMM_1877_DB_IEMR.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/db/migration/dbiemr/{V29__AMM_1877_DB_IEMR.sql => V33__AMM_1877_DB_IEMR.sql} (100%) diff --git a/src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V33__AMM_1877_DB_IEMR.sql similarity index 100% rename from src/main/resources/db/migration/dbiemr/V29__AMM_1877_DB_IEMR.sql rename to src/main/resources/db/migration/dbiemr/V33__AMM_1877_DB_IEMR.sql From 1ef9f6e8c4ffff7f51e93f1cc14641571b64cda9 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Mon, 5 Jan 2026 15:48:07 +0530 Subject: [PATCH 14/17] AMM-2035 --- .../db/migration/dbiemr/V34__AMM_2035.sql | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/main/resources/db/migration/dbiemr/V34__AMM_2035.sql diff --git a/src/main/resources/db/migration/dbiemr/V34__AMM_2035.sql b/src/main/resources/db/migration/dbiemr/V34__AMM_2035.sql new file mode 100644 index 00000000..82538fdd --- /dev/null +++ b/src/main/resources/db/migration/dbiemr/V34__AMM_2035.sql @@ -0,0 +1,39 @@ +USE db_iemr; + +CREATE TABLE IF NOT EXISTS `anc_counselling_care` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `beneficiary_id` bigint NOT NULL, + `visit_date` date DEFAULT NULL, + `home_visit_date` date NOT NULL, + `anc_visit_id` bigint NOT NULL, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `select_all` tinyint(1) DEFAULT 0, + `swelling` tinyint(1) DEFAULT 0, + `high_bp` tinyint(1) DEFAULT 0, + `convulsions` tinyint(1) DEFAULT 0, + `anemia` tinyint(1) DEFAULT 0, + `reduced_fetal_movement` tinyint(1) DEFAULT 0, + `age_risk` tinyint(1) DEFAULT 0, + `child_gap` tinyint(1) DEFAULT 0, + `short_height` tinyint(1) DEFAULT 0, + `pre_preg_weight` tinyint(1) DEFAULT 0, + `bleeding` tinyint(1) DEFAULT 0, + `miscarriage_history` tinyint(1) DEFAULT 0, + `four_plus_delivery` tinyint(1) DEFAULT 0, + `first_delivery` tinyint(1) DEFAULT 0, + `twin_pregnancy` tinyint(1) DEFAULT 0, + `c_section_history` tinyint(1) DEFAULT 0, + `pre_existing_disease` tinyint(1) DEFAULT 0, + `fever_malaria` tinyint(1) DEFAULT 0, + `jaundice` tinyint(1) DEFAULT 0, + `sickle_cell` tinyint(1) DEFAULT 0, + `prolonged_labor` tinyint(1) DEFAULT 0, + `malpresentation` tinyint(1) DEFAULT 0, + `user_id` int DEFAULT NULL, + `created_by` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `updated_by` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB +DEFAULT CHARSET=utf8mb4 +COLLATE=utf8mb4_unicode_ci; From 944149cf19c30086dd8659239b27b05ba2e51e4d Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Mon, 5 Jan 2026 15:49:47 +0530 Subject: [PATCH 15/17] AMM-2035 --- .../dbiemr/V33__AMM_1877_DB_IEMR.sql | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 src/main/resources/db/migration/dbiemr/V33__AMM_1877_DB_IEMR.sql diff --git a/src/main/resources/db/migration/dbiemr/V33__AMM_1877_DB_IEMR.sql b/src/main/resources/db/migration/dbiemr/V33__AMM_1877_DB_IEMR.sql deleted file mode 100644 index 888e58cb..00000000 --- a/src/main/resources/db/migration/dbiemr/V33__AMM_1877_DB_IEMR.sql +++ /dev/null @@ -1,74 +0,0 @@ --- ======================================== --- Migration: Create New Tables --- ======================================== -USE db_iemr; - -------------------------------------------------------------- --- form_module -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `form_module` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `module_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` datetime DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -------------------------------------------------------------- --- form_master -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `form_master` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `form_id` varchar(100) NOT NULL, - `form_name` varchar(255) NOT NULL, - `module_id` bigint DEFAULT NULL, - `created_at` datetime DEFAULT CURRENT_TIMESTAMP, - `version` int DEFAULT 1, - PRIMARY KEY (`id`), - UNIQUE KEY (`form_id`), - KEY `fk_module` (`module_id`), - CONSTRAINT `fk_module` FOREIGN KEY (`module_id`) REFERENCES `form_module` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -------------------------------------------------------------- --- form_fields -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `form_fields` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `form_id` varchar(100) NOT NULL, - `section_title` varchar(255), - `field_id` varchar(100) NOT NULL, - `label` varchar(255), - `type` varchar(100), - `is_required` tinyint(1), - `default_value` varchar(255), - `placeholder` varchar(255), - `options` longtext, - `validation` longtext, - `conditional` longtext, - `sequence` int, - `created_at` datetime DEFAULT CURRENT_TIMESTAMP, - `is_visible` tinyint(1) DEFAULT 0, - PRIMARY KEY (`id`), - KEY `fk_form` (`form_id`), - CONSTRAINT `fk_form` FOREIGN KEY (`form_id`) REFERENCES `form_master` (`form_id`) ON DELETE CASCADE, - CONSTRAINT `form_fields_chk_1` CHECK (json_valid(`options`)), - CONSTRAINT `form_fields_chk_2` CHECK (json_valid(`validation`)), - CONSTRAINT `form_fields_chk_3` CHECK (json_valid(`conditional`)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -------------------------------------------------------------- --- m_translation -------------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `m_translation` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `label_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `english` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , - `hindi_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , - `is_active` tinyint(1) NOT NULL DEFAULT 1, - `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `updated_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `assamese_translation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `label_key` (`label_key`) - ) ENGINE=InnoDB AUTO_INCREMENT=452 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; From c71b0484860a42b300eb25530968634bf861e344 Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Wed, 7 Jan 2026 15:04:12 +0530 Subject: [PATCH 16/17] rename version --- .../db/migration/dbiemr/{V34__AMM_2035.sql => V38__AMM_2035.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/db/migration/dbiemr/{V34__AMM_2035.sql => V38__AMM_2035.sql} (100%) diff --git a/src/main/resources/db/migration/dbiemr/V34__AMM_2035.sql b/src/main/resources/db/migration/dbiemr/V38__AMM_2035.sql similarity index 100% rename from src/main/resources/db/migration/dbiemr/V34__AMM_2035.sql rename to src/main/resources/db/migration/dbiemr/V38__AMM_2035.sql From 17757d65d19953f55640d3ff38ca6e5855830cfb Mon Sep 17 00:00:00 2001 From: Saurav Mishra Date: Wed, 18 Mar 2026 12:26:42 +0530 Subject: [PATCH 17/17] update version name --- .../db/migration/dbiemr/V38__AMM_2035.sql | 39 ------------------- .../db/migration/dbiemr/V67__AMM_2035.sql | 37 ++++++++++++++++++ 2 files changed, 37 insertions(+), 39 deletions(-) delete mode 100644 src/main/resources/db/migration/dbiemr/V38__AMM_2035.sql create mode 100644 src/main/resources/db/migration/dbiemr/V67__AMM_2035.sql diff --git a/src/main/resources/db/migration/dbiemr/V38__AMM_2035.sql b/src/main/resources/db/migration/dbiemr/V38__AMM_2035.sql deleted file mode 100644 index 82538fdd..00000000 --- a/src/main/resources/db/migration/dbiemr/V38__AMM_2035.sql +++ /dev/null @@ -1,39 +0,0 @@ -USE db_iemr; - -CREATE TABLE IF NOT EXISTS `anc_counselling_care` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `beneficiary_id` bigint NOT NULL, - `visit_date` date DEFAULT NULL, - `home_visit_date` date NOT NULL, - `anc_visit_id` bigint NOT NULL, - `created_at` datetime DEFAULT CURRENT_TIMESTAMP, - `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `select_all` tinyint(1) DEFAULT 0, - `swelling` tinyint(1) DEFAULT 0, - `high_bp` tinyint(1) DEFAULT 0, - `convulsions` tinyint(1) DEFAULT 0, - `anemia` tinyint(1) DEFAULT 0, - `reduced_fetal_movement` tinyint(1) DEFAULT 0, - `age_risk` tinyint(1) DEFAULT 0, - `child_gap` tinyint(1) DEFAULT 0, - `short_height` tinyint(1) DEFAULT 0, - `pre_preg_weight` tinyint(1) DEFAULT 0, - `bleeding` tinyint(1) DEFAULT 0, - `miscarriage_history` tinyint(1) DEFAULT 0, - `four_plus_delivery` tinyint(1) DEFAULT 0, - `first_delivery` tinyint(1) DEFAULT 0, - `twin_pregnancy` tinyint(1) DEFAULT 0, - `c_section_history` tinyint(1) DEFAULT 0, - `pre_existing_disease` tinyint(1) DEFAULT 0, - `fever_malaria` tinyint(1) DEFAULT 0, - `jaundice` tinyint(1) DEFAULT 0, - `sickle_cell` tinyint(1) DEFAULT 0, - `prolonged_labor` tinyint(1) DEFAULT 0, - `malpresentation` tinyint(1) DEFAULT 0, - `user_id` int DEFAULT NULL, - `created_by` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `updated_by` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB -DEFAULT CHARSET=utf8mb4 -COLLATE=utf8mb4_unicode_ci; diff --git a/src/main/resources/db/migration/dbiemr/V67__AMM_2035.sql b/src/main/resources/db/migration/dbiemr/V67__AMM_2035.sql new file mode 100644 index 00000000..960b71a2 --- /dev/null +++ b/src/main/resources/db/migration/dbiemr/V67__AMM_2035.sql @@ -0,0 +1,37 @@ +USE db_iemr; + +CREATE TABLE IF NOT EXISTS `anc_counselling_care` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `beneficiary_id` bigint NOT NULL, + `visit_date` date DEFAULT NULL, + `home_visit_date` date NOT NULL, + `anc_visit_id` bigint NOT NULL, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `select_all` tinyint(1) DEFAULT '0', + `swelling` tinyint(1) DEFAULT '0', + `high_bp` tinyint(1) DEFAULT '0', + `convulsions` tinyint(1) DEFAULT '0', + `anemia` tinyint(1) DEFAULT '0', + `reduced_fetal_movement` tinyint(1) DEFAULT '0', + `age_risk` tinyint(1) DEFAULT '0', + `child_gap` tinyint(1) DEFAULT '0', + `short_height` tinyint(1) DEFAULT '0', + `pre_preg_weight` tinyint(1) DEFAULT '0', + `bleeding` tinyint(1) DEFAULT '0', + `miscarriage_history` tinyint(1) DEFAULT '0', + `four_plus_delivery` tinyint(1) DEFAULT '0', + `first_delivery` tinyint(1) DEFAULT '0', + `twin_pregnancy` tinyint(1) DEFAULT '0', + `c_section_history` tinyint(1) DEFAULT '0', + `pre_existing_disease` tinyint(1) DEFAULT '0', + `fever_malaria` tinyint(1) DEFAULT '0', + `jaundice` tinyint(1) DEFAULT '0', + `sickle_cell` tinyint(1) DEFAULT '0', + `prolonged_labor` tinyint(1) DEFAULT '0', + `malpresentation` tinyint(1) DEFAULT '0', + `user_id` int DEFAULT NULL, + `created_by` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `updated_by` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`) + ) ;