<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
                      http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">

    <changeSet id="0001" author="gulnaz">
        <comment>add sent_date column to user_application_list table</comment>
        <sql>
            ALTER TABLE user_application_list ADD COLUMN IF NOT EXISTS sent_date timestamp without time zone;
            COMMENT ON COLUMN user_application_list.sent_date IS 'Дата отправки заявки в ЕРВУ';

            UPDATE user_application_list SET sent_date = now()
            WHERE application_status = 'SENT' and sent_date is null;
        </sql>
    </changeSet>

</databaseChangeLog>
