002-quality-quarantine-locations.xml 1.31 KB
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
                                       https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.27.xsd">

    <!--
        pbc-quality v1.1: add OPTIONAL source / quarantine location
        columns so REJECTED inspections can trigger pbc-warehousing's
        auto-quarantine subscriber. Both columns are nullable — when
        either is unset the subscriber is a no-op and the inspection
        is still recorded + the event is still published.
    -->

    <changeSet id="quality-add-quarantine-locations" author="vibe_erp">
        <comment>Add nullable source_location_code and quarantine_location_code columns</comment>
        <sql>
            ALTER TABLE quality__inspection_record
                ADD COLUMN source_location_code     varchar(64),
                ADD COLUMN quarantine_location_code varchar(64);
        </sql>
        <rollback>
            ALTER TABLE quality__inspection_record
                DROP COLUMN source_location_code,
                DROP COLUMN quarantine_location_code;
        </rollback>
    </changeSet>

</databaseChangeLog>