Skip to content

Commit

Permalink
add script to update type of column MINVT_WRD_ID_A of oh_medicaldsrin…
Browse files Browse the repository at this point in the history
…ventory
  • Loading branch information
ArnaudFofou committed Nov 20, 2024
1 parent cb20185 commit 987ddae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions sql/step_04_all_following_steps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ source step_a109_update_user_settings_table_constraints_and_add_usergroups_permi
source step_a110_update_operations_table_change_ope_for_to_enum.sql;
source step_a111_add_missing_lock_columns.sql;
source step_a112_users_and_groups_soft_deletion.sql;
source step_a113_alter_table_medicalinventory.sql;
12 changes: 12 additions & 0 deletions sql/step_a113_alter_table_medicalinventory.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- Step 1: Drop the foreign key constraint
ALTER TABLE OH_MEDICALDSRINVENTORY
DROP CONSTRAINT oh_medicaldsrinventory_ibfk_2;

-- Step 2: Change the data type of the foreign key column
ALTER TABLE OH_MEDICALDSRINVENTORY
MODIFY MINVT_WRD_ID_A CHAR(3);

-- Step 3: Recreate the foreign key constraint
ALTER TABLE OH_MEDICALDSRINVENTORY
ADD CONSTRAINT oh_medicaldsrinventory_ibfk_2
FOREIGN KEY (MINVT_WRD_ID_A) REFERENCES OH_WARD (WRD_ID_A);

0 comments on commit 987ddae

Please sign in to comment.