Skip to content

Commit

Permalink
Merge pull request #481 from njorocs/etl-recreate-fix
Browse files Browse the repository at this point in the history
Disabling foreign key checks to allow dropping of etl databases and r…
  • Loading branch information
patryllus authored Sep 12, 2024
2 parents a509a30 + 13abbdc commit e5422a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions omod/src/main/resources/sql/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ BEGIN
DECLARE script_id INT(11);

-- create/recreate database kenyaemr_etl
SET FOREIGN_KEY_CHECKS = 0;
drop database if exists kenyaemr_etl;
SET FOREIGN_KEY_CHECKS = 1;
create database kenyaemr_etl DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

drop database if exists kenyaemr_datatools;
Expand Down
4 changes: 2 additions & 2 deletions omod/src/main/resources/sql/dwapi/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ BEGIN
DECLARE script_id INT(11);

-- create/recreate database dwapi_etl
SET FOREIGN_KEY_CHECKS = 0;
drop database if exists dwapi_etl;
SET FOREIGN_KEY_CHECKS = 1;
create database dwapi_etl DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;



-- Log start time
INSERT INTO kenyaemr_etl.etl_script_status(script_name, start_time) VALUES('initial_creation_of_dwapi_tables', NOW());
SET script_id = LAST_INSERT_ID();
Expand Down

0 comments on commit e5422a2

Please sign in to comment.