-
Notifications
You must be signed in to change notification settings - Fork 13
Migration/amm 2035 #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SauravBizbRolly
wants to merge
17
commits into
main
Choose a base branch
from
migration/AMM_2035
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
99cbd94
Dynamic Form for db changes
SauravBizbRolly 32f3642
Dynamic Form for db changes
SauravBizbRolly aa048ce
Dynamic Form for db changes
SauravBizbRolly 1f84119
Dynamic Form for db changes
SauravBizbRolly dbec5e5
Dynamic Form for db changes
SauravBizbRolly 80f8a02
Dynamic Form for db changes
SauravBizbRolly b63cf34
Merge pull request #63 from toarunmishra/migration/dynamic_form_db_chβ¦
SauravBizbRolly ec49166
soft-delete AMM-2040,AMM-2060
SauravBizbRolly f05d397
soft-delete AMM-2040,AMM-2060
SauravBizbRolly 0e13f53
dynamic form tables AMM-1877
SauravBizbRolly 4706783
soft-delete AMM-2040,AMM-2060
SauravBizbRolly fa9b21e
dynamic form tables AMM-1877
SauravBizbRolly 2f208bc
dynamic form tables AMM-1877
SauravBizbRolly 0c3719a
dynamic form tables AMM-1877
SauravBizbRolly 1ef9f6e
AMM-2035
SauravBizbRolly 944149c
AMM-2035
SauravBizbRolly c71b048
rename version
SauravBizbRolly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add indexes on foreign key columns for query performance.
The columns
beneficiary_id,anc_visit_id, anduser_idappear to be foreign key references that will be frequently used in JOIN operations and WHERE clauses. Without indexes, queries will perform full table scans, leading to poor performance as the table grows.β‘ Proposed fix to add indexes
Add these lines before the closing parenthesis and after the PRIMARY KEY definition:
Also applies to: 8-8, 33-33
π€ Prompt for AI Agents
π§© Analysis chain
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 1868
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 1432
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 39220
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 2066
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 1560
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 3049
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 762
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 2530
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 124
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 8498
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 40
π Script executed:
Repository: PSMRI/AMRIT-DB
Length of output: 60
Add foreign key constraints to enforce referential integrity.
The columns
user_idandanc_visit_idshould referencem_user(UserID)andt_anc_visit(id)respectively. This schema consistently uses FK constraints across other transactional tables; missing them here creates inconsistency and increases risk of orphaned records. Thebeneficiary_idcolumn also warrants consideration, though it references the identity database.π€ Prompt for AI Agents