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

  <changeSet id="0001" author="hairuulin.b" dbms="postgresql">
    <comment>drop constraint</comment>
    <sql>
	ALTER TABLE IF EXISTS ONLY recruitment_campaign.postponement_info
    DROP CONSTRAINT IF EXISTS postponement_info_fk1;
    </sql>
  </changeSet>
  
  <changeSet id="0002" author="hairuulin.b" dbms="postgresql">
    <comment>add snils and inn to citizen</comment>
    <sql>
	ALTER TABLE IF EXISTS ervu_dashboard.citizen
    ADD COLUMN IF NOT EXISTS snils text,
	ADD COLUMN IF NOT EXISTS inn text,
	ADD COLUMN IF NOT EXISTS email text,
	ADD COLUMN IF NOT EXISTS died_date date;
	COMMENT ON COLUMN ervu_dashboard.citizen.snils is 'СНИЛС';
	COMMENT ON COLUMN ervu_dashboard.citizen.inn is 'ИНН';
	COMMENT ON COLUMN ervu_dashboard.citizen.email is 'Емаил';
	COMMENT ON COLUMN ervu_dashboard.citizen.died_date is 'Дата смерти';
	</sql>
  </changeSet>
  
  <changeSet id="0003" author="hairuulin.b" dbms="postgresql">
    <comment>drop constraint</comment>
    <sql>
	ALTER TABLE IF EXISTS appeals.reasons_appeal
    DROP CONSTRAINT IF EXISTS reasons_appeal_fk1;
    </sql>
  </changeSet>
  
  <changeSet id="0004" author="hairuulin.b" dbms="postgresql">
    <comment>alter table appeals</comment>
    <sql>
	ALTER TABLE IF EXISTS appeals.reasons_appeal
    ADD COLUMN IF NOT EXISTS sending_documents numeric,
	ADD COLUMN IF NOT EXISTS sending_documents_percent numeric,
	ADD COLUMN IF NOT EXISTS complaint_withdrawal numeric,
	ADD COLUMN IF NOT EXISTS complaint_withdrawal_percent numeric,
	ADD COLUMN IF NOT EXISTS decision_disagreement numeric,
	ADD COLUMN IF NOT EXISTS decision_disagreement_persent numeric;
	--DROP COLUMN no_data,
	--DROP COLUMN no_data_percent,
	--DROP COLUMN other,
	--DROP COLUMN other_percent;
	COMMENT ON COLUMN appeals.reasons_appeal.sending_documents IS 'Досыл документов';
	COMMENT ON COLUMN appeals.reasons_appeal.sending_documents_percent IS 'Досыл документов (проценты)';
	COMMENT ON COLUMN appeals.reasons_appeal.complaint_withdrawal IS 'Отзыв жалобы';
	COMMENT ON COLUMN appeals.reasons_appeal.complaint_withdrawal_percent IS 'Отзыв жалобы (проценты)';
	COMMENT ON COLUMN appeals.reasons_appeal.decision_disagreement IS 'Несогласие с решением';
	COMMENT ON COLUMN appeals.reasons_appeal.decision_disagreement_persent IS 'Несогласие с решением (проценты)';
    </sql>
  </changeSet>
  
  
  
</databaseChangeLog>
