<?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="saliakhov">
        <comment>create owner</comment>
		<sql>
			ALTER TABLE IF EXISTS deregistration.removal_registration OWNER to ervu_business_metrics;
			ALTER TABLE IF EXISTS metrics.incidents_files_requests OWNER to ervu_business_metrics;
		</sql>
	</changeSet>
	
	<changeSet id="0002" author="saliakhov">
        <comment>edit table</comment>
		<sql>
			DROP VIEW IF EXISTS deregistration.view_incidents_info;

			ALTER TABLE deregistration.incidents_info DROP COLUMN IF EXISTS count_for_sign;
			ALTER TABLE deregistration.incidents_info DROP COLUMN IF EXISTS count_signed;

			ALTER TABLE deregistration.incidents_info ADD COLUMN IF NOT EXISTS count_incidents_registration int8 DEFAULT 0 NOT NULL;

			COMMENT ON COLUMN deregistration.incidents_info.count_incidents_registration IS 'инцидентов зарегистрировано';
		</sql>
	</changeSet>
	
	
</databaseChangeLog>