<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
                      http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd">

<changeSet id="0001" author="AlexSave">
  <preConditions onFail="MARK_RAN">
    <not>
      <tableExists tableName="recruit_ervu_status" schemaName="ervu_dashboard"/>
    </not>
  </preConditions>
  <createTable tableName="recruit_ervu_status" schemaName="ervu_dashboard" remarks="Справочник статусов ЕРВУ">
    <column name="recruit_ervu_status_id" type="BIGSERIAL">
      <constraints primaryKey="true" nullable="false"/>
    </column>
    <column name="code" type="varchar(15)" remarks="Cправочный код статуса">
      <constraints nullable="false"/>
    </column>
    <column name="value" type="varchar(255)" remarks="Значение статуса">
      <constraints nullable="false"/>
    </column>
    <column name="description" type="text" remarks="Описание статуса"/>
    <column name="actual" type="boolean" defaultValueBoolean="true" remarks="Признак актуальности справочного значения">
      <constraints nullable="false"/>
    </column>
  </createTable>
  <addUniqueConstraint tableName="recruit_ervu_status"
                       columnNames="code"
                       constraintName="recruit_ervu_status_code_unique_key"
                       schemaName="ervu_dashboard"/>
  <rollback>
    <dropTable tableName="recruit_ervu_status" schemaName="ervu_dashboard"/>
  </rollback>
</changeSet>


</databaseChangeLog>