<?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="tihomirov">
    <comment>add audit table</comment>
    <sql>
      CREATE TABLE IF NOT EXISTS public.user_application_list_audit (
      id uuid NOT NULL DEFAULT uuid_generate_v4(),
      user_application_list_id bigserial,
      date TIMESTAMP WITHOUT TIME ZONE DEFAULT now(),
      status character varying(100),
      fio character varying(1000),
      login character varying(1000)
      )
      TABLESPACE pg_default;

      ALTER TABLE IF EXISTS public.user_application_list_audit
      OWNER TO ervu_account_applications;

      GRANT ALL ON TABLE public.user_application_role TO ervu_account_applications;
    </sql>
  </changeSet>

</databaseChangeLog>