<?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="adel.ka">
        <comment>create table border_crossing</comment>
		<sql>
			CREATE TABLE IF NOT EXISTS ervu_dashboard.border_crossing
			(
			id bigserial NOT NULL,
			recruit_id uuid NOT NULL,
			date_crossing date,
			return_date date,
			CONSTRAINT border_crossing_pkey PRIMARY KEY (id)
			);

			COMMENT ON TABLE ervu_dashboard.border_crossing
			IS 'сведения о фактах пересечения границы РФ';

			COMMENT ON COLUMN ervu_dashboard.border_crossing.date_crossing
			IS 'дата пересечения границы';

			COMMENT ON COLUMN ervu_dashboard.border_crossing.return_date
			IS 'дата возвращения';

			ALTER TABLE IF EXISTS ervu_dashboard.citizenship
			DROP COLUMN IF EXISTS date_departure_abroad;

			ALTER TABLE IF EXISTS ervu_dashboard.citizenship
			DROP COLUMN IF EXISTS return_date;
		</sql>
	</changeSet>
</databaseChangeLog>