Skip to content
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

PLAT-82: Add PostgreSQL support #77

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 30 additions & 11 deletions api/src/main/resources/liquibase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,19 +314,24 @@
</changeSet>

<changeSet id="create-auto-close-queue-entry-task-20230616" author="makombe">
<validCheckSum>8:6614a6aa5f2fd2e14304b48bff8c4b6d</validCheckSum>
<preConditions>
<sqlCheck expectedResult="0">
SELECT COUNT(*) FROM scheduler_task_config WHERE name = "Auto close queue entries Task";
SELECT COUNT(*) FROM scheduler_task_config WHERE name = 'Auto close queue entries Task';
</sqlCheck>
</preConditions>
<sql>
INSERT INTO
scheduler_task_config(name, description, schedulable_class, start_time, start_time_pattern, repeat_interval,
start_on_startup, created_by, date_created, uuid)
VALUES
('Auto close queue entries Task', 'Auto close queue entries Task', 'org.openmrs.module.queue.tasks.AutoCloseQueueEntryTask',
TIMESTAMP(CURDATE()), 'MM/dd/yyyy HH:mm:ss', 86400, TRUE, 1, NOW(), UUID());
</sql>
<insert tableName="scheduler_task_config">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you confirm that that modifying this changeset will not lead to validation checksum errors?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I create a separate changeset for Postgresql?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkayiwa updated this by adding a validCheckSum tag.

<column name="name" value="Auto close queue entries Task"/>
<column name="description" value="Auto close queue entries Task"/>
<column name="schedulable_class" value="org.openmrs.module.queue.tasks.AutoCloseQueueEntryTask"/>
<column name="start_time" valueDate="NOW()"/>
<column name="start_time_pattern" value="MM/dd/yyyy HH:mm:ss"/>
<column name="repeat_interval" valueNumeric="86400"/>
<column name="start_on_startup" valueBoolean="true"/>
<column name="created_by" valueNumeric="1"/>
<column name="date_created" valueDate="NOW()"/>
<column name="uuid" valueComputed="UUID()"/>
</insert>
</changeSet>

<changeSet id="add_location_coming_from_column_to_queue_entry_20230809" author="cynthiakamau">
Expand Down Expand Up @@ -377,7 +382,7 @@
<preConditions>
<not>
<sqlCheck expectedResult="0">
SELECT COUNT(*) FROM scheduler_task_config WHERE name = "Auto close queue entries Task";
SELECT COUNT(*) FROM scheduler_task_config WHERE name = 'Auto close queue entries Task';
</sqlCheck>
</not>
</preConditions>
Expand All @@ -400,7 +405,7 @@
<addForeignKeyConstraint baseColumnNames="visit_id" baseTableName="queue_entry" constraintName="queue_entry_visit_id_fk" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="visit_id" referencedTableName="visit"/>
</changeSet>

<changeSet id="migrate_visit_id_to_queue_entry_20231025" author="mseaton">
<changeSet id="migrate_visit_id_to_queue_entry_20231025" author="mseaton" dbms="mysql,mariadb">
<preConditions onFail="MARK_RAN">
<tableExists tableName="visit_queue_entries"/>
</preConditions>
Expand All @@ -411,6 +416,20 @@
</sql>
</changeSet>

<changeSet id="migrate_visit_id_to_queue_entry_20231025_postgres" author="wikumChamith" dbms="postgresql">
<preConditions onFail="MARK_RAN">
<tableExists tableName="visit_queue_entries"/>
</preConditions>
<sql>
UPDATE queue_entry qe
SET visit_id = (
SELECT vqe.visit_id
FROM visit_queue_entries vqe
WHERE qe.queue_entry_id = vqe.queue_entry_id
);
</sql>
</changeSet>

<changeSet id="drop_visit_queue_entries_20231025" author="mseaton">
<preConditions onFail="MARK_RAN">
<tableExists tableName="visit_queue_entries"/>
Expand Down
Loading