Skip to content
Open
Changes from 1 commit
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
16 changes: 15 additions & 1 deletion configuration/pih/liquibase/liquibase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -643,5 +643,19 @@
<comment>Remove old authentication events following bug fixes</comment>
<delete tableName="authentication_event_log"/>
</changeSet>


<changeSet id="20221101-initial-create-of-petl-load-times-table" author="ddesimone">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="0">
select table_exists("petl_load_times");
Copy link
Member

Choose a reason for hiding this comment

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

Better to follow existing standard and conventions here. See where I add the authentication_event_log table. Something like:

<not><tableExists tableName="petl_load_times"/></not>

</sqlCheck>
</preConditions>
<sql>
drop table if exists petl_load_times;
create table petl_load_times
(loaded_domain varchar(50),
last_loaded_time datetime);
</sql>
Copy link
Member

Choose a reason for hiding this comment

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

Again, better to use the liquibase constructs for this, as done throughout this liquibase.xml file. First, no need (and not desireable) to have the drop table if exists... statement. Your precondition already guarantees that it doesn't exist. Second, in order to create the table, use the liquibase tags for this (again, see where I add the authentication event log table). Something like:

        <createTable tableName="petl_load_times">
            <column name="loaded_domain" type="varchar(50)"/>
            <column name="last_loaded_time" type="datetime"/>
        </createTable>

</changeSet>

</databaseChangeLog>