-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* update the param of getMedicalsWard method * update file step_a104_add_inventory_in_pharmacy.sql * add script to update type of column MINVT_WRD_ID_A of oh_medicaldsrinventory * revert step_a104_add_inventory_in_pharmacy.sql * Update sql/step_a113_alter_table_medicalinventory.sql * update the name of the contraint for foreign key --------- Co-authored-by: ArnaudFofou <[email protected]> Co-authored-by: Alessandro Domanico <[email protected]>
- Loading branch information
1 parent
9e238b4
commit 30fdddc
Showing
5 changed files
with
61 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,50 @@ | ||
-- Step 1: Drop the foreign key constraint | ||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
DROP CONSTRAINT oh_medicaldsrinventory_ibfk_2; | ||
|
||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
DROP CONSTRAINT oh_medicaldsrinventory_ibfk_1; | ||
|
||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
DROP CONSTRAINT oh_medicaldsrinventory_ibfk_3; | ||
|
||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
DROP CONSTRAINT oh_medicaldsrinventory_ibfk_4; | ||
|
||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
DROP CONSTRAINT oh_medicaldsrinventory_ibfk_5; | ||
|
||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
DROP CONSTRAINT oh_medicaldsrinventory_ibfk_6; | ||
|
||
-- Step 2: Change the data type of the foreign key column | ||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
MODIFY COLUMN MINVT_WRD_ID_A CHAR(3); | ||
|
||
-- Step 3: Recreate the foreign key constraint | ||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
ADD CONSTRAINT FK_MEDICALDSRINVENTORY_WARD_1 | ||
FOREIGN KEY (MINVT_WRD_ID_A) REFERENCES OH_WARD (WRD_ID_A); | ||
|
||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
ADD CONSTRAINT FK_MEDICALDSRINVENTORY_USER | ||
FOREIGN KEY (MINVT_US_ID_A) REFERENCES OH_USER (US_ID_A); | ||
|
||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
ADD CONSTRAINT FK_MEDICALDSRINVENTORY_MEDICALDSRSTOCKMOVTYPE_1 | ||
FOREIGN KEY (MINVT_CHARGE_TYPE) REFERENCES OH_MEDICALDSRSTOCKMOVTYPE (MMVT_ID_A); | ||
|
||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
ADD CONSTRAINT FK_MEDICALDSRINVENTORY_MEDICALDSRSTOCKMOVTYPE_2 | ||
FOREIGN KEY (MINVT_DISCHARGE_TYPE) REFERENCES OH_MEDICALDSRSTOCKMOVTYPE (MMVT_ID_A); | ||
|
||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
ADD CONSTRAINT FK_MEDICALDSRINVENTORY_SUPPLIER | ||
FOREIGN KEY (MINVT_SUPPLIER) REFERENCES OH_SUPPLIER (SUP_ID); | ||
|
||
ALTER TABLE OH_MEDICALDSRINVENTORY | ||
ADD CONSTRAINT FK_MEDICALDSRINVENTORY_WARD_2 | ||
FOREIGN KEY (MINVT_DESTINATION) REFERENCES OH_WARD (WRD_ID_A); | ||
|
||
|
||
|
This file contains 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
This file contains 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
This file contains 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