<?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="hairullin">
        <comment>create EXTENSION uuid-ossp</comment>
        <sql>
            CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
        </sql>
    </changeSet>

    <changeSet id="0002" author="hairullin">
        <comment>add table job_position and insert values</comment>
        <sql>
           CREATE TABLE IF NOT EXISTS public.job_position
			(
				job_position_id bigserial,
				name character varying(100) COLLATE pg_catalog."default" NOT NULL,
				code character varying(100) COLLATE pg_catalog."default" NOT NULL,
				start_date timestamp without time zone NOT NULL DEFAULT now(),
				close_date timestamp without time zone,
				CONSTRAINT pk_job_position PRIMARY KEY (job_position_id)
			)
			TABLESPACE pg_default;
			ALTER TABLE IF EXISTS public.job_position
			OWNER to ervu_account_applications; 
			
			INSERT INTO public.job_position ("name",code,start_date,close_date) VALUES
			('Руководитель','MANAGER','2024-10-07 15:39:26.69628',NULL),
			('Специалист','USER','2024-10-07 15:39:26.69628',NULL);
		</sql>
    </changeSet>

    <changeSet id="0003" author="hairullin">
        <comment>add table user_application_document</comment>
        <sql>
           CREATE TABLE IF NOT EXISTS public.user_application_document
			(
				user_application_document_id bigserial,
				file_name character varying(100) COLLATE pg_catalog."default",
				file bytea,
				user_application_list_id bigint NOT NULL,
				CONSTRAINT pk_user_application_document PRIMARY KEY (user_application_document_id)
			)
			TABLESPACE pg_default;
			ALTER TABLE IF EXISTS public.user_application_document
				OWNER to ervu_account_applications;
        </sql>
    </changeSet>

    <changeSet id="0004" author="hairullin">
        <comment>add table user_application_list</comment>
        <sql>
        CREATE TABLE IF NOT EXISTS public.user_application_list
			(
				user_application_list_id bigserial,
				application_kind character varying(100) COLLATE pg_catalog."default" NOT NULL,
				user_login character varying(100) COLLATE pg_catalog."default" NOT NULL,
				user_password character varying(100) COLLATE pg_catalog."default",
				secondname character varying(1000) COLLATE pg_catalog."default" NOT NULL,
				firstname character varying(1000) COLLATE pg_catalog."default" NOT NULL,
				middlename character varying(1000) COLLATE pg_catalog."default",
				phone character varying(20) COLLATE pg_catalog."default",
				ip_address character varying(1000) COLLATE pg_catalog."default",
				start_date timestamp without time zone NOT NULL DEFAULT now(),
				close_date timestamp without time zone,
				user_status character varying(50) COLLATE pg_catalog."default",
				application_status character varying(100) COLLATE pg_catalog."default" NOT NULL,
				comment character varying COLLATE pg_catalog."default",
				job_position_id bigint,
				user_role_id bigint,
				recruitment_id uuid,
				user_account_id character varying COLLATE pg_catalog."default",
				sex character varying COLLATE pg_catalog."default",
				birth_date date,
				snils character varying COLLATE pg_catalog."default",
				job_position character varying COLLATE pg_catalog."default",
				ip_address_additional character varying COLLATE pg_catalog."default",
				number_app bigserial,
				edit_comment character varying COLLATE pg_catalog."default",
				CONSTRAINT pk_user_application_list PRIMARY KEY (user_application_list_id)
			)
			TABLESPACE pg_default;
			ALTER TABLE IF EXISTS public.user_application_list
				OWNER to ervu_account_applications; 
        </sql>
    </changeSet>
	
    <changeSet id="0005" author="hairullin">
        <comment>add table link_user_application_user_group</comment>
        <sql>
		CREATE TABLE IF NOT EXISTS public.link_user_application_user_group
			(
				link_user_application_user_group_id bigserial,
				user_application_list_id bigint NOT NULL,
				user_group_id character(36) COLLATE pg_catalog."default" NOT NULL,
				created timestamp without time zone DEFAULT now(),
				CONSTRAINT pk_link_user_application_user_group PRIMARY KEY (link_user_application_user_group_id),
				CONSTRAINT uni_user_group UNIQUE (user_application_list_id, user_group_id),
				CONSTRAINT fk_user_application_list FOREIGN KEY (user_application_list_id)
					REFERENCES public.user_application_list (user_application_list_id) MATCH SIMPLE
					ON UPDATE NO ACTION
					ON DELETE CASCADE,
				CONSTRAINT fk_user_group FOREIGN KEY (user_group_id)
					REFERENCES security.user_group (user_group_id) MATCH SIMPLE
					ON UPDATE NO ACTION
					ON DELETE NO ACTION
			)
			TABLESPACE pg_default;
			ALTER TABLE IF EXISTS public.link_user_application_user_group
				OWNER to ervu_account_applications;
			GRANT ALL ON TABLE public.link_user_application_user_group TO ervu_account_applications;	
        </sql>
    </changeSet>

    <changeSet id="0006" author="hairullin">
        <comment>add table recruitment and insert values</comment>
        <sql>
		CREATE TABLE IF NOT EXISTS public.recruitment
			(
				id uuid NOT NULL DEFAULT uuid_generate_v4(),
				idm_id character varying(256) COLLATE pg_catalog."default",
				parent_id character varying COLLATE pg_catalog."default",
				version integer,
				created_at timestamp without time zone NOT NULL DEFAULT now(),
				updated_at timestamp without time zone NOT NULL DEFAULT now(),
				schema character varying(64) COLLATE pg_catalog."default" NOT NULL,
				military_code character varying(16) COLLATE pg_catalog."default",
				shortname character varying COLLATE pg_catalog."default" NOT NULL,
				fullname character varying COLLATE pg_catalog."default" NOT NULL,
				dns character varying(64) COLLATE pg_catalog."default",
				email character varying(255) COLLATE pg_catalog."default",
				phone character varying(24) COLLATE pg_catalog."default",
				address character varying COLLATE pg_catalog."default",
				address_id character varying COLLATE pg_catalog."default",
				postal_address character varying COLLATE pg_catalog."default",
				postal_address_id character varying COLLATE pg_catalog."default",
				nsi_department_id character varying COLLATE pg_catalog."default",
				nsi_organization_id character varying COLLATE pg_catalog."default",
				oktmo character varying COLLATE pg_catalog."default",
				org_ogrn character varying COLLATE pg_catalog."default",
				dep_ogrn character varying COLLATE pg_catalog."default",
				epgu_id character varying COLLATE pg_catalog."default",
				kpp character varying(64) COLLATE pg_catalog."default",
				inn character varying(64) COLLATE pg_catalog."default",
				okato character varying(64) COLLATE pg_catalog."default",
				division_type character varying(64) COLLATE pg_catalog."default",
				tns_department_id character varying COLLATE pg_catalog."default",
				enabled boolean NOT NULL DEFAULT true,
				timezone character varying(64) COLLATE pg_catalog."default",
				reports_enabled boolean,
				region_id character varying COLLATE pg_catalog."default",
				subpoena_series_code character varying(64) COLLATE pg_catalog."default",
				hidden boolean NOT NULL DEFAULT false,
				region_code text COLLATE pg_catalog."default",
				ts timestamp without time zone NOT NULL DEFAULT now(),
				CONSTRAINT recruitment_pkey PRIMARY KEY (id),
				CONSTRAINT recruitment_idm_id_key UNIQUE (idm_id)
			)
			TABLESPACE pg_default;
			ALTER TABLE IF EXISTS public.recruitment
				OWNER to ervu_account_applications;
			COMMENT ON TABLE public.recruitment
				IS 'Военный комиссариат';
			COMMENT ON COLUMN public.recruitment.id
				IS 'Идентификатор ВК';
			COMMENT ON COLUMN public.recruitment.idm_id
				IS 'Идентификатор организации';
			COMMENT ON COLUMN public.recruitment.parent_id
				IS 'Идентификатор вышестоящей организации';
			COMMENT ON COLUMN public.recruitment.version
				IS 'Версия записи';
			COMMENT ON COLUMN public.recruitment.created_at
				IS 'Дата создания';
			COMMENT ON COLUMN public.recruitment.updated_at
				IS 'Дата обновления';
			COMMENT ON COLUMN public.recruitment.schema
				IS 'Схема';
			COMMENT ON COLUMN public.recruitment.military_code
				IS 'Код организации';
			COMMENT ON COLUMN public.recruitment.shortname
				IS 'Укороченное наименование организации';
			COMMENT ON COLUMN public.recruitment.fullname
				IS 'Полное наименование организации';
			COMMENT ON COLUMN public.recruitment.dns
				IS 'ДНС организации';
			COMMENT ON COLUMN public.recruitment.email
				IS 'Е-mail организации';
			COMMENT ON COLUMN public.recruitment.phone
				IS 'Телефон организации';
			COMMENT ON COLUMN public.recruitment.address
				IS 'Адрес организации';
			COMMENT ON COLUMN public.recruitment.address_id
				IS 'Идентификатор адреса организации';
			COMMENT ON COLUMN public.recruitment.postal_address
				IS 'Почтовый адрес организации';
			COMMENT ON COLUMN public.recruitment.postal_address_id
				IS 'Идентификатор почтового адреса организации';
			COMMENT ON COLUMN public.recruitment.nsi_department_id
				IS 'Идентификатор департамента из НСИ';
			COMMENT ON COLUMN public.recruitment.nsi_organization_id
				IS 'Идентификатор организации из НСИ';
			COMMENT ON COLUMN public.recruitment.oktmo
				IS 'ОКТМО';
			COMMENT ON COLUMN public.recruitment.org_ogrn
				IS 'ОГРН организации';
			COMMENT ON COLUMN public.recruitment.dep_ogrn
				IS 'ОГРН департамента';
			COMMENT ON COLUMN public.recruitment.epgu_id
				IS 'Идентификатор ЕПГУ';
			COMMENT ON COLUMN public.recruitment.kpp
				IS 'КПП';
			COMMENT ON COLUMN public.recruitment.inn
				IS 'ИНН';
			COMMENT ON COLUMN public.recruitment.okato
				IS 'ОКАТО';
			COMMENT ON COLUMN public.recruitment.division_type
				IS 'Тип дивизиона';
			COMMENT ON COLUMN public.recruitment.tns_department_id
				IS 'Идентификатор департамента из ТНС';
			COMMENT ON COLUMN public.recruitment.enabled
				IS 'Признак актуальности';
			COMMENT ON COLUMN public.recruitment.timezone
				IS 'Часовой пояс';
			COMMENT ON COLUMN public.recruitment.reports_enabled
				IS 'Признак актуальности для отчета';
			COMMENT ON COLUMN public.recruitment.region_id
				IS 'Идентификатор региона';
			COMMENT ON COLUMN public.recruitment.subpoena_series_code
				IS 'Серия';
			COMMENT ON COLUMN public.recruitment.hidden
				IS 'Признак скрытого';
			-- Index: recruitment_idm_idx
			CREATE INDEX IF NOT EXISTS recruitment_idm_idx
				ON public.recruitment USING btree
				(idm_id COLLATE pg_catalog."default" ASC NULLS LAST)
				TABLESPACE pg_default;
			-- Index: recruitment_military_code_idx
			CREATE INDEX IF NOT EXISTS recruitment_military_code_idx
				ON public.recruitment USING btree
				(military_code COLLATE pg_catalog."default" ASC NULLS LAST)
				TABLESPACE pg_default;
			-- Index: recruitment_parent_idx
			CREATE INDEX IF NOT EXISTS recruitment_parent_idx
				ON public.recruitment USING btree
				(parent_id COLLATE pg_catalog."default" ASC NULLS LAST)
				TABLESPACE pg_default;
			-- Index: recruitment_region_idx
			CREATE INDEX IF NOT EXISTS recruitment_region_idx
				ON public.recruitment USING btree
				(region_id COLLATE pg_catalog."default" ASC NULLS LAST)
				TABLESPACE pg_default;
       </sql>
    </changeSet>

    <changeSet id="0007" author="hairullin">
        <comment>insert values into "security".org_unit</comment>
        <sql>
			INSERT INTO "security".org_unit (id,"name",code,parent_id,removed) VALUES
				 ('20f455d2-2908-4a86-8ab5-2e500f2f5544','Министерство обороны','f03fc8c0-2ce7-4121-a306-f82d65ea029d',NULL,false),
				 ('e00feef8-7b8a-47c2-9a16-f0f7dc877f56','Восточный военный округ','b23f384f-b114-4003-9277-2eaa2d9ae180',NULL,false),
				 ('72cd6795-0303-4894-82ad-911bc259d87e','Московский военный округ','30a01af9-a871-411a-90e3-d81592bb074f',NULL,false),
				 ('d29346a7-dc0f-452d-859f-9bd3a83c219c','Ленинградский военный округ','25633423-52e6-45bb-9d54-7f85b74a3f7d',NULL,false),
				 ('826c2187-7761-48ff-9399-25d1cc2a9297','Центральный военный округ','58ef9cdc-8a9d-429e-89a5-1c49e2684a98',NULL,false),
				 ('a7b1f5f2-e43f-44da-92c6-6f394f53ec95','Южный военный округ','b00de68d-2e09-4776-9b48-1566a7222dca',NULL,false),
				 ('fb2a5e9b-5c86-4c6f-bea0-c4501d466549','Тестовый комиссариат 2','83779471-c29f-c2eb-0e70-7846af31d10e',NULL,false),
				 ('521ce853-5cec-4d2c-8aa5-8f73e5ac3376','FDfsafd','31b88ed6-263e-225d-0787-74f7ef25f5f6',NULL,false),
				 ('30de0a5c-a8df-4591-9bdc-52bfe5abb31d','Военный комиссариат Вятска Тест','5055a985-c97c-f5dc-2158-ff5862bfe4cf',NULL,false) on conflict do nothing;
			INSERT INTO "security".org_unit (id,"name",code,parent_id,removed) VALUES
				 ('f8010c28-ec1b-415f-9546-f1b58e36279e','Тестовая организация Тест Второй','8edec280-3143-4d45-b702-ad5e91ef0e52',NULL,false),
				 ('ba28c023-72f4-4ef5-b209-631f72f9488e','Военный комиссариат городских округов Курильский и Северо-Курильский Сахалинской области','ce08e909-5a14-480f-b931-bff172872ac6',NULL,false),
				 ('4d3daef5-a63d-417c-8235-97c2b772a182','Военный комиссариат городского округа Южно-Курильский Сахалинской области','6da64c78-6705-4567-9f5f-5ade5822d92f',NULL,false),
				 ('a3188467-3169-4b4e-847c-ffcca71c4440','Военный комиссариат города Долинск и Долинского района Сахалинской области','110686b2-4a01-4976-885b-d26a2980f53a',NULL,false),
				 ('a67c6e12-b1fe-406b-b080-6b518324d6ea','Военный комиссариат города Невельск и Невельского района Сахалинской области','98d428b3-502e-42b6-a29e-a469f894ac16',NULL,false),
				 ('bb80fa73-9e50-491c-98c1-1869d752bba7','Военный комиссариат Краснинского района Липецкой области','8127c345-3fc1-4864-9d6e-cf34e69c494c',NULL,false),
				 ('e6c40dc8-0065-42c2-8c50-87714b3a0f7c','Военный комиссариат Лебедянского района Липецкой области','b2238b19-8598-4dfa-bb49-0de95136e344',NULL,false),
				 ('cef595ce-c5af-44bb-9711-b0b7fd5b2df4','Тестовый муниципальный комиссариат 2','54a95ecd-1530-424c-8da1-882622b2df83',NULL,false),
				 ('3a36fc6d-e2d4-414b-a995-e6c8bff78b77','Военный комиссариат города Холмск и Холмского района Сахалинской области','67dacb06-d1f7-4c0e-9891-32863353cae9',NULL,false),
				 ('659ed98b-9868-4168-adff-35e9e1bd9b0b','Военный комиссариат города Поронайск, Макаровского, Поронайского и Смирныховского районов Сахалинской области','24b7ba55-9757-45d9-9c5e-5ca3e8c9c2d0',NULL,false) on conflict do nothing;
			INSERT INTO "security".org_unit (id,"name",code,parent_id,removed) VALUES
				 ('8a1f8307-76c9-4923-a0fe-88bc6a563fcb','АУВафцыва','20d82cbf-d520-48ce-a02a-540ce3838087',NULL,false),
				 ('6fabcb61-584f-401d-85f6-79a49e3d8f61','Военный комиссариат Измалковского района Липецкой области','52e97a4c-f68c-489a-a923-fabb9ef574dd',NULL,false),
				 ('08f29c2e-0682-4179-a8f1-21a278c22d26','Военный комиссариат Долгоруковского района Липецкой области','94a9f485-eab9-4158-a1bf-330d23e29ae2',NULL,false),
				 ('c93d2dc2-7741-4ca7-9690-14c764a77bf0','Военный комиссариат Задонского района Липецкой области','f4e38f22-d974-412b-8a34-b1933ca865a9',NULL,false),
				 ('d01db5cc-086b-4609-9aad-2c6397c4dd96','Военный комиссариат города Данков, Данковского и Лев-Толстовского района Липецкой области','2545944e-5252-4a6f-bcb2-8a4adf720e9b',NULL,false),
				 ('939dd496-542a-45f4-91e0-90c331d85f5f','Военный комиссариат Хлевенского района Липецкой области','3a56b060-20ee-4b62-9d96-4c6bf4928039',NULL,false),
				 ('fd142737-1a6a-466f-a318-b1412b184b3d','Военный комиссариат Шиловского и Путятинского районов Рязанской области','79f6c236-3ee8-40ff-bc10-40077420e82e',NULL,false),
				 ('50439548-a88f-4e49-93a1-ce29c1eb9b9a','Военный комиссариат Ухоловского, Сапожковского и Сараевского районов Рязанской области','86fc6ed6-1d82-4536-8066-c9ff2ca68639',NULL,false),
				 ('908c5c7a-2942-4083-acbf-3a03c739b860','Военный комиссариат города Шацк, Шацкого и Чучковского районов Рязанской области','e22cfafc-b8b1-47fd-b9f4-b9015734d578',NULL,false),
				 ('928411d1-b6c2-40ea-a3df-4cad7aec98a5','Военный комиссариат Московского и Железнодорожного районов города Рязань Рязанской области','2ca66dd6-6688-45c9-bb7e-988c7e92d34a',NULL,false) on conflict do nothing;
			INSERT INTO "security".org_unit (id,"name",code,parent_id,removed) VALUES
				 ('da5a8694-eae5-4da1-81b9-54ac3ac178f2','Военный комиссариат Клепиковского района Рязанской области','55727f17-6ab4-4d51-ad32-ba8e916acf49',NULL,false),
				 ('9b83cc97-0439-458e-bc45-08315eb4d9b8','Военный комиссариат Рязанского и Спасского районов Рязанской области','6562ddb0-3f0c-4e43-bf0c-a834421cd4db',NULL,false),
				 ('cbc0917a-3052-41ea-a97e-f482b2c81b2d','Военный комиссариат города Скопин, Скопинского и Милославского районов Рязанской области','f59afe6d-c166-4196-a489-6d17f02fc05e',NULL,false),
				 ('b2e6bca2-d7eb-4654-8aef-d5c529e1c899','Военный комиссариат Сахалинской области','84bc45ab-c032-410e-9dc5-07e92719ede4',NULL,false),
				 ('3cab3b8a-15f2-4c69-a3be-e7485717baa2','Тестовый комиссариат 1','e8f52736-3997-4e3a-c9e4-5bfca6eddc89',NULL,false),
				 ('67db7b5b-0892-4908-bd20-864f932e80f9','Главное организационно-мобилизационное управление','5d8e4e2b-37d7-44a8-accb-45e87b62aa2d',NULL,false),
				 ('6e1017e2-1e38-481f-85c2-e828247f2b79','Восьмое управление ГШ ВС РФ','553b9449-6460-48c4-88d4-f18283abc4a7',NULL,false),
				 ('69865d28-3f69-4047-8d4d-9469a6c33d5f','Военный комиссариат Октябрьского и Советского районов города Рязань Рязанской области','6139de3b-2378-496f-9fca-7df7dab90832',NULL,false),
				 ('77df47ff-f9d1-47f6-89c5-dc214b91a2a2','Военный комиссариат Липецкой области','2137685f-0683-4131-82d8-983222114184',NULL,false),
				 ('38392eea-e14b-48b5-a0a1-2cff65bcb396','Военный комиссариат Рязанской области','092d6963-287c-454e-8d73-8e09ebee972e',NULL,false) on conflict do nothing;
			INSERT INTO "security".org_unit (id,"name",code,parent_id,removed) VALUES
				 ('1cb021ac-4335-40d4-987c-7c7648d104be','Военный комиссариат города Оха и Охинского района Сахалинской области','5eadc746-674d-4ba0-95d6-414d3469c82b',NULL,false),
				 ('2330352b-59ff-4b3f-b534-196fb5b20f9a','ВК Одинцовского городского округа городских округов Краснознаменск и Власиха Московской области','3b71b6ff-3eec-4cca-fed0-055bb0c163cc',NULL,false),
				 ('4b2365ea-b799-48d4-ab00-b6f6dac5b952','тест','bce5663e-5fe1-94a7-40f9-71d0490459da',NULL,false),
				 ('4e36849b-6652-483d-aecf-a3d9e18e42b9','Военный комиссариат Кораблинского района Рязанской области','0fe2bdf0-afbb-402d-93da-67e511799afa',NULL,false),
				 ('8bd65d2b-630c-4513-964b-d70b48726bc5','Военный комиссариат города Липецк Липецкой области','9703f108-761a-467a-aad3-89617e5539ed',NULL,false),
				 ('2caa5eae-b6c8-4943-8b8b-428dc9c6cb4d','Военный комиссариат города Грязи и Грязинского района Липецкой области','b5209c2c-67f6-4b6d-9617-8370aa9907a8',NULL,false),
				 ('b00a1841-f444-4fb4-827a-a4e1075eac01','Военный комиссариат города Углегорск, Томаринского и Углегорского районов Сахалинской области','121d7da8-5f40-4e79-900a-ddba5a62f8aa',NULL,false),
				 ('0b6eaee2-e52c-4d79-ab97-921a98007539','НЕ трогать оргу Андреева','731b87ec-91e7-cf82-afcc-b2967439f7ae',NULL,false),
				 ('fb0ec464-70e8-421b-bb20-8a12bf5780c4','Военный комиссариат Чаплыгинского района Липецкой области','4b0309d6-f28a-49db-8950-5ffebd917e1e',NULL,false),
				 ('610d1eee-a270-4f35-b8aa-df017e102b5c','Муниципального Военный Комиссариат Вятска','10b67909-b154-45e3-8eef-7f0fac9abb5d',NULL,false) on conflict do nothing;
			INSERT INTO "security".org_unit (id,"name",code,parent_id,removed) VALUES
				 ('f7fadde2-de94-4386-926a-48f539b14564','Военный комиссариат города Елец и Елецкого района Липецкой области','b042e073-e4ff-4873-b33e-4d44d17ec72d',NULL,false),
				 ('1c213331-711b-4263-8275-a0e099e0f78d','Военный комиссариат Анивского района Сахалинской области','cff66da8-2be0-4839-bd8e-332b1a150031',NULL,false),
				 ('7e17cb21-4dfb-4f66-8996-1f87e78f8533','Военный комиссариат города Южно-Сахалинск Сахалинской области','2966d239-5241-4acb-9b4f-707ba75f44d5',NULL,false),
				 ('dde8fd00-3648-49ed-a40e-c7caa58cab8d','Военный комиссариат Ногликского района Сахалинской области','eba7fd7d-e3da-49a7-8e65-8fc85e47190e',NULL,false),
				 ('1eabf1d8-3202-4359-b6be-dd045afbfa40','Военный комиссариат Липецкого района Липецкой области','70a19cf0-203a-4d04-a1c5-62c811c5ae66',NULL,false),
				 ('e4671f49-8155-447a-a35c-67cb6468803a','Военный комиссариат Усманского района Липецкой области','70b872b5-79de-4ef6-b5f3-11ecc68906bc',NULL,false),
				 ('618c4e20-c2b1-4783-bd35-3d5f897e5b83','Тестовый муниципальный комиссариат 1','00148448-3ad9-4e0d-b9d2-c5e81a05bcf6',NULL,false),
				 ('0b713936-42c9-4e40-bde3-e941220b81de','Военный комиссариат Звениговского района Республики Марий Эл','34c8685e-f08a-4877-afb1-a0589800a21c',NULL,false),
				 ('dbe21bb3-0416-4682-844a-07132e896a4b','Тестовая организация','fa005a7c-f833-0727-1924-990584ca6fee',NULL,false),
				 ('674eb255-c2a6-45e7-8395-46118f95cb9f','Военный комиссариат Становлянского района Липецкой области','786b4e73-42dd-4c36-968e-8cce5d9debc6',NULL,false) on conflict do nothing;
			INSERT INTO "security".org_unit (id,"name",code,parent_id,removed) VALUES
				 ('78a69506-f876-4549-add0-dd9b95e4cde9','Тестовый муниципальный комиссариат 3','5584b973-f5c0-4aee-ae5a-0b0d0444ad1b',NULL,false),
				 ('7aaab069-b993-469c-9cdc-d05b48e01da2','Тестовый муниципальный комиссариат 4','d49f28d4-0eca-4fd7-b68c-a0a693223de0',NULL,false),
				 ('58e31fcf-567c-4b4c-8bc7-eb5fb9676f08','тестт','6daa4999-df84-4469-bcc7-0f875affd41a',NULL,false),
				 ('e2683ce5-7de8-43b8-9ff3-2a2dc23a4e7c','Военный комиссариат республики Мари Эл','bb7aa36f-446e-4262-a609-28694ca2e398',NULL,false),
				 ('0068b57d-1272-467d-8cfd-fb3edb9ce430','Военный комиссариат Сернурского района Республики Марий Эл','6f60bde2-33f8-4b33-be9f-cd57a6e041c4',NULL,false),
				 ('1ac66d8e-29ad-4cab-93fc-cced8d8b94b6','Военный комиссариат города Йошкар-Ола Республики Марий Эл','55eae374-9bb5-4295-9e3a-5fbcdaba870d',NULL,false),
				 ('efdbd421-c2b7-4d4a-a2b0-9a377595b060','Военный комиссариат Мари-Турекского и Параньгинского районов Республики Марий Эл','30ce4b57-17ca-4b01-b685-1303ce22e3f2',NULL,false),
				 ('44cbc7da-0243-4ec1-a3e0-604599501502','Военный комиссариат Куженерского района Республики Марий Эл','d5dd717e-d2f4-4e93-860a-1bb1a97beb46',NULL,false),
				 ('10653db1-856c-4f9b-b624-55bd2345380b','Военный комиссариат города Волжск и Волжского района Республики Марий Эл','2befcbb4-7eb3-4a77-a3cb-f7f0eb0fab2e',NULL,false),
				 ('9e0d94ef-2c1f-4335-9279-497357dfe550','Военный комиссариат Советского района Республики Марий Эл','0ce35443-78f6-473a-97f2-e1f2d5ba7a4e',NULL,false) on conflict do nothing;
			INSERT INTO "security".org_unit (id,"name",code,parent_id,removed) VALUES
				 ('51f57f8b-b2ef-4409-89cd-55b544c1dfcd','Военный комиссариат Оршанского района Республики Марий Эл','ac702380-5836-4bed-b846-a8c15b241a84',NULL,false),
				 ('b08c1d90-915a-4bb4-a6c4-f44e2af9e63d','Военный комиссариат Медедевского и Килемарского района Республики Марий Эл','6ed8b34f-d049-4b7f-8d1b-b99a1852236b',NULL,false),
				 ('8667f0ec-4ca3-4668-8846-8b665cebda8d','Военный комиссариат города Козьмодемьянск, Горномарийского и Юринского районов Республики Марий Эл','fc10523f-af31-4f6b-b0e2-00799758f634',NULL,false),
				 ('a933e951-88c0-421d-a291-33fa4cea36fc','Военный комиссариат Моркинского района Республики Марий Эл','1ff99d4f-7418-46bc-9c60-61a0e4ec77bd',NULL,false),
				 ('58684643-1498-446e-bd62-8883d17f72bd','Военный комиссариат Вятска Тест','9a4640f6-143a-7642-51bd-d2b5ac5e9d1e',NULL,false),
				 ('6693233b-7893-43b5-80f5-08b282c35156','Военный комиссариат Добринского района Липецкой области','1cf09194-0f3b-4f2c-a14f-03604d68ff8f',NULL,false),
				 ('b9c6bc65-f4be-4b7e-842b-1c4d90f0c07f','Вторая организация','52b4ee14-5af8-c029-26c2-80faba9e967d',NULL,false),
				 ('46c0431c-6d5e-469c-9b89-2f0ed33c2cef','Военный комиссариат Добровского района Липецкой области','9c459101-fa10-4468-acbb-ce34df064aa1',NULL,false),
				 ('4e4c712e-f3bb-4f2f-8cf1-6e1c9bda2677','Второе подразделение','5ea50fa7-0b85-4a27-8293-dbd36162cb9a',NULL,false),
				 ('4da4fafb-f3ba-4f18-8140-54fffd552d59','Военный комиссариат Тербунского и Воловского районов Липецкой области','a2d517d4-a6c3-4cb8-8d9b-3c8d15a7007c',NULL,false) on conflict do nothing;
			INSERT INTO "security".org_unit (id,"name",code,parent_id,removed) VALUES
				 ('d740fa3c-bb0a-42d7-9ba6-347fc7b57e4a','АВфвафв','4c062d4a-3f77-c850-6388-dde909e3946b',NULL,false),
				 ('dfe9ce08-7f82-4d59-a21d-65c1a9f1ed3b','Военный комиссариат города Корсаков и Корсаковского района Сахалинской области','bacac23b-477f-4c26-8973-d83f0ca387fb',NULL,false),
				 ('9c09e210-6dd9-4bc3-a8ad-f3dd4d1cc70a','Военный комиссариат города Александровск-Сахалинский, Александровск-Сахалинского и Тымовского районов Сахалинской области','82518cee-d3ce-40fd-a5b4-3e12647afc45',NULL,false),
				 ('4dcebf08-40b2-4ba0-8fe8-700d67cdc5b2','Военный комиссариат Рыбновского района Рязанской области','22c64b79-f8e4-41e7-a2f3-1aa9df424fd9',NULL,false),
				 ('3e77b04b-168d-4f27-a4b4-dce4ac71f394','Военный комиссариат города Михайлов, Михайловского и Захаровского районов Рязанской области','27f7b3c0-a222-45e0-896f-58bdf4341a41',NULL,false),
				 ('e7eaf26b-e0b6-4b1f-8a8b-c7f4ec26fb90','Военный комиссариат города Касимов и Касимовского района Рязанской области','370bc761-ae40-46f1-b4d8-974317b5ceb6',NULL,false),
				 ('d05d4f2f-168f-48c8-8817-f6403654a614','Тестовая Организация','d1efbe15-744e-8521-5b8e-7ac604e4379b',NULL,false),
				 ('2386a304-73a2-40ce-b3ec-f02d688f3b20','Военный комиссариат Пронского и Старожиловского районов Рязанской области','37c187fe-4f37-45e6-9246-07148112367c',NULL,false),
				 ('4ac5c009-5dc4-4ed3-a2ae-ec3a583d8ec0','Военный комиссариат Ряжского и Александро-Невского районов Рязанской области','dad6c101-34be-45c3-8173-57190cb69dfb',NULL,false),
				 ('aa6f0546-fc5d-4c51-a22d-27a8ce0041f3','Военный комиссариат города Сасово, Ермишинского, Кадомского, Сасовского и Пителинского районов Рязанской области','f6a7fb8b-379f-4802-bf00-73f9c493825f',NULL,false) on conflict do nothing;
			INSERT INTO "security".org_unit (id,"name",code,parent_id,removed) VALUES
				 ('8000b421-4a1a-4db4-97f7-e01daaa93f42','Военный комиссариат Новоторъяльского района Республики Марий Эл','0e10678c-f272-41c3-94dd-c15830321f9a',NULL,false),
				 ('ce800cef-2d23-43e3-974f-6b79de3270ae','Администрация городского округа Щёлково Московской области','fe655d90-893a-31f7-ff8b-9ccef8af0f83',NULL,false),
				 ('3b767267-c2ef-468c-9e67-114ec4105832','ВК городских округов Щелково Фрязино Звездный городок и Лосино-Петровского городского округа Московской области','e079ea79-50f1-4af4-beea-1b7648e86ce9',NULL,false) on conflict do nothing;
        </sql>
    </changeSet>

	<changeSet id="0008" author="hairullin">
        <comment>insert values into "security".org_unit_additional_info</comment>
        <sql>
			CREATE TABLE IF NOT EXISTS security.org_unit_additional_info
			(
				id character(36) COLLATE pg_catalog."default" NOT NULL,
				schema character varying(1000) COLLATE pg_catalog."default" NOT NULL,
				CONSTRAINT pk_org_unit_additional_info PRIMARY KEY (id)
			)
			TABLESPACE pg_default;
			ALTER TABLE IF EXISTS security.org_unit_additional_info
				OWNER to ervu_account_applications;
			GRANT ALL ON TABLE security.org_unit_additional_info TO ervu_account_applications;
		</sql>
    </changeSet>
	
	<changeSet id="0009" author="hairullin">
        <comment>insert values into "security".org_unit_additional_info</comment>
        <sql>
			INSERT INTO "security".org_unit_additional_info (id,"schema") VALUES
				 ('20f455d2-2908-4a86-8ab5-2e500f2f5544','Ministry'),
				 ('e00feef8-7b8a-47c2-9a16-f0f7dc877f56','Region'),
				 ('72cd6795-0303-4894-82ad-911bc259d87e','Region'),
				 ('d29346a7-dc0f-452d-859f-9bd3a83c219c','Region'),
				 ('826c2187-7761-48ff-9399-25d1cc2a9297','Region'),
				 ('a7b1f5f2-e43f-44da-92c6-6f394f53ec95','Region'),
				 ('fb2a5e9b-5c86-4c6f-bea0-c4501d466549','Organization'),
				 ('521ce853-5cec-4d2c-8aa5-8f73e5ac3376','Organization'),
				 ('30de0a5c-a8df-4591-9bdc-52bfe5abb31d','Organization'),
				 ('f8010c28-ec1b-415f-9546-f1b58e36279e','Department') on conflict do nothing;
			INSERT INTO "security".org_unit_additional_info (id,"schema") VALUES
				 ('ba28c023-72f4-4ef5-b209-631f72f9488e','Department'),
				 ('4d3daef5-a63d-417c-8235-97c2b772a182','Department'),
				 ('a3188467-3169-4b4e-847c-ffcca71c4440','Department'),
				 ('a67c6e12-b1fe-406b-b080-6b518324d6ea','Department'),
				 ('bb80fa73-9e50-491c-98c1-1869d752bba7','Department'),
				 ('e6c40dc8-0065-42c2-8c50-87714b3a0f7c','Department'),
				 ('cef595ce-c5af-44bb-9711-b0b7fd5b2df4','Department'),
				 ('3a36fc6d-e2d4-414b-a995-e6c8bff78b77','Department'),
				 ('659ed98b-9868-4168-adff-35e9e1bd9b0b','Department'),
				 ('8a1f8307-76c9-4923-a0fe-88bc6a563fcb','Department') on conflict do nothing;
			INSERT INTO "security".org_unit_additional_info (id,"schema") VALUES
				 ('6fabcb61-584f-401d-85f6-79a49e3d8f61','Department'),
				 ('08f29c2e-0682-4179-a8f1-21a278c22d26','Department'),
				 ('c93d2dc2-7741-4ca7-9690-14c764a77bf0','Department'),
				 ('d01db5cc-086b-4609-9aad-2c6397c4dd96','Department'),
				 ('939dd496-542a-45f4-91e0-90c331d85f5f','Department'),
				 ('fd142737-1a6a-466f-a318-b1412b184b3d','Department'),
				 ('50439548-a88f-4e49-93a1-ce29c1eb9b9a','Department'),
				 ('908c5c7a-2942-4083-acbf-3a03c739b860','Department'),
				 ('928411d1-b6c2-40ea-a3df-4cad7aec98a5','Department'),
				 ('da5a8694-eae5-4da1-81b9-54ac3ac178f2','Department') on conflict do nothing;
			INSERT INTO "security".org_unit_additional_info (id,"schema") VALUES
				 ('9b83cc97-0439-458e-bc45-08315eb4d9b8','Department'),
				 ('cbc0917a-3052-41ea-a97e-f482b2c81b2d','Department'),
				 ('b2e6bca2-d7eb-4654-8aef-d5c529e1c899','Organization'),
				 ('3cab3b8a-15f2-4c69-a3be-e7485717baa2','Organization'),
				 ('67db7b5b-0892-4908-bd20-864f932e80f9','Organization'),
				 ('6e1017e2-1e38-481f-85c2-e828247f2b79','Organization'),
				 ('69865d28-3f69-4047-8d4d-9469a6c33d5f','Department'),
				 ('77df47ff-f9d1-47f6-89c5-dc214b91a2a2','Organization'),
				 ('38392eea-e14b-48b5-a0a1-2cff65bcb396','Organization'),
				 ('1cb021ac-4335-40d4-987c-7c7648d104be','Department') on conflict do nothing;
			INSERT INTO "security".org_unit_additional_info (id,"schema") VALUES
				 ('2330352b-59ff-4b3f-b534-196fb5b20f9a','Organization'),
				 ('4b2365ea-b799-48d4-ab00-b6f6dac5b952','Organization'),
				 ('4e36849b-6652-483d-aecf-a3d9e18e42b9','Department'),
				 ('8bd65d2b-630c-4513-964b-d70b48726bc5','Department'),
				 ('2caa5eae-b6c8-4943-8b8b-428dc9c6cb4d','Department'),
				 ('b00a1841-f444-4fb4-827a-a4e1075eac01','Department'),
				 ('0b6eaee2-e52c-4d79-ab97-921a98007539','Organization'),
				 ('fb0ec464-70e8-421b-bb20-8a12bf5780c4','Department'),
				 ('610d1eee-a270-4f35-b8aa-df017e102b5c','Department'),
				 ('f7fadde2-de94-4386-926a-48f539b14564','Department') on conflict do nothing;
			INSERT INTO "security".org_unit_additional_info (id,"schema") VALUES
				 ('1c213331-711b-4263-8275-a0e099e0f78d','Department'),
				 ('7e17cb21-4dfb-4f66-8996-1f87e78f8533','Department'),
				 ('dde8fd00-3648-49ed-a40e-c7caa58cab8d','Department'),
				 ('1eabf1d8-3202-4359-b6be-dd045afbfa40','Department'),
				 ('e4671f49-8155-447a-a35c-67cb6468803a','Department'),
				 ('618c4e20-c2b1-4783-bd35-3d5f897e5b83','Department'),
				 ('0b713936-42c9-4e40-bde3-e941220b81de','Department'),
				 ('dbe21bb3-0416-4682-844a-07132e896a4b','Organization'),
				 ('674eb255-c2a6-45e7-8395-46118f95cb9f','Department'),
				 ('78a69506-f876-4549-add0-dd9b95e4cde9','Department') on conflict do nothing;
			INSERT INTO "security".org_unit_additional_info (id,"schema") VALUES
				 ('7aaab069-b993-469c-9cdc-d05b48e01da2','Department'),
				 ('58e31fcf-567c-4b4c-8bc7-eb5fb9676f08','Department'),
				 ('e2683ce5-7de8-43b8-9ff3-2a2dc23a4e7c','Organization'),
				 ('0068b57d-1272-467d-8cfd-fb3edb9ce430','Department'),
				 ('1ac66d8e-29ad-4cab-93fc-cced8d8b94b6','Department'),
				 ('efdbd421-c2b7-4d4a-a2b0-9a377595b060','Department'),
				 ('44cbc7da-0243-4ec1-a3e0-604599501502','Department'),
				 ('10653db1-856c-4f9b-b624-55bd2345380b','Department'),
				 ('9e0d94ef-2c1f-4335-9279-497357dfe550','Department'),
				 ('51f57f8b-b2ef-4409-89cd-55b544c1dfcd','Department') on conflict do nothing;
			INSERT INTO "security".org_unit_additional_info (id,"schema") VALUES
				 ('b08c1d90-915a-4bb4-a6c4-f44e2af9e63d','Department'),
				 ('8667f0ec-4ca3-4668-8846-8b665cebda8d','Department'),
				 ('a933e951-88c0-421d-a291-33fa4cea36fc','Department'),
				 ('58684643-1498-446e-bd62-8883d17f72bd','Organization'),
				 ('6693233b-7893-43b5-80f5-08b282c35156','Department'),
				 ('b9c6bc65-f4be-4b7e-842b-1c4d90f0c07f','Organization'),
				 ('46c0431c-6d5e-469c-9b89-2f0ed33c2cef','Department'),
				 ('4e4c712e-f3bb-4f2f-8cf1-6e1c9bda2677','Department'),
				 ('4da4fafb-f3ba-4f18-8140-54fffd552d59','Department'),
				 ('d740fa3c-bb0a-42d7-9ba6-347fc7b57e4a','Organization') on conflict do nothing;
			INSERT INTO "security".org_unit_additional_info (id,"schema") VALUES
				 ('dfe9ce08-7f82-4d59-a21d-65c1a9f1ed3b','Department'),
				 ('9c09e210-6dd9-4bc3-a8ad-f3dd4d1cc70a','Department'),
				 ('4dcebf08-40b2-4ba0-8fe8-700d67cdc5b2','Department'),
				 ('3e77b04b-168d-4f27-a4b4-dce4ac71f394','Department'),
				 ('e7eaf26b-e0b6-4b1f-8a8b-c7f4ec26fb90','Department'),
				 ('d05d4f2f-168f-48c8-8817-f6403654a614','Organization'),
				 ('2386a304-73a2-40ce-b3ec-f02d688f3b20','Department'),
				 ('4ac5c009-5dc4-4ed3-a2ae-ec3a583d8ec0','Department'),
				 ('aa6f0546-fc5d-4c51-a22d-27a8ce0041f3','Department'),
				 ('8000b421-4a1a-4db4-97f7-e01daaa93f42','Department') on conflict do nothing;
			INSERT INTO "security".org_unit_additional_info (id,"schema") VALUES
				 ('ce800cef-2d23-43e3-974f-6b79de3270ae','Organization'),
				 ('3b767267-c2ef-468c-9e67-114ec4105832','Department') on conflict do nothing;
        </sql>
    </changeSet>

    <changeSet id="0010" author="hairullin">
        <comment>insert values into "security".user_role</comment>
        <sql>
			INSERT INTO "security".user_role (user_role_id,"name",created,updated) VALUES
				 ('17c97647-f53c-400f-a700-ad349eeee0c3','Ответственный за ЗИ','2024-10-09 16:39:06+03','2024-10-09 16:39:06+03'),
				 ('68a81927-259d-4e2a-84d7-c565a9d0f943','Администратор ПОИБ','2024-10-09 16:39:06+03','2024-10-09 16:39:06+03') on conflict do nothing;
			INSERT INTO "security".user_role (user_role_id,"name",created,updated) VALUES
				 ('726dc966-6832-4f5c-b867-2797259d5104','Ответственный за ЗИ СВК','2024-10-09 16:39:06+03','2024-10-09 16:39:06+03'),
				 ('65b50a78-4f68-4bd9-9836-4fb3e2fb2c6a','Управления параметрами информационной безопасности','2024-10-09 16:39:06+03','2024-10-09 16:39:06+03'),
				 ('cc1ac346-71bf-4fa7-9300-78730a1bed08','Список пользователей','2024-10-09 16:39:06+03','2024-10-09 16:39:06+03'),
				 ('720d8a2b-1b30-4002-9a44-8e531c86460c','Сотрудник ВК','2024-10-17 12:11:00+03','2024-10-17 12:11:00+03'),
				 ('30c92f56-439c-463d-829c-93bcbf6b64d1','Военный комиссар','2024-10-17 12:11:00+03','2024-10-18 18:07:50+03'),
				 ('422e6caf-4f53-4e0f-83f9-af4897cf75ef','Военком','2024-10-18 20:27:23+03','2024-10-18 20:27:23+03') on conflict do nothing;
        </sql>
    </changeSet>
	
	<changeSet id="0011" author="hairullin">
        <comment>insert values into "security".user_group</comment>
        <sql>
			INSERT INTO "security".user_group (user_group_id,"name",created,updated,access_level_id) VALUES
				 ('25d720ff-fa5e-41f2-bbe9-0db90187b0f4','Ответственный за ЗИ','2024-10-09 20:47:31+03','2024-10-09 20:47:31+03','a6bf4b31-6648-4095-b269-2a950b548a10'),
				 ('acf292b2-9b46-4bf2-9254-39696d26f02b','Ответственный за ЗИ СВК','2024-10-09 20:49:39+03','2024-10-09 20:49:39+03','a6bf4b31-6648-4095-b269-2a950b548a10'),
				 ('00fe3742-dbb3-4639-aabd-3a10050ecd9e','Администратор ПОИБ','2024-10-09 20:51:04+03','2024-10-09 20:51:04+03','a6bf4b31-6648-4095-b269-2a950b548a10'),
				 ('6428cb6d-2949-4570-85b5-4b81e33b19ff','Сотрудник ВК','2024-10-17 12:15:42+03','2024-10-17 12:15:42+03','a6bf4b31-6648-4095-b269-2a950b548a10') on conflict do nothing;
			INSERT INTO "security".user_group (user_group_id,"name",created,updated,access_level_id) VALUES
				 ('0c61996f-c1db-483e-8456-5a5a9dc6dcdd','Военный комиссар','2024-10-17 12:15:30+03','2024-10-18 18:08:04+03','a6bf4b31-6648-4095-b269-2a950b548a10') on conflict do nothing;
        </sql>
    </changeSet>
	
	<changeSet id="0012" author="hairullin">
        <comment>insert values into link_user_group_user_role</comment>
        <sql>
			INSERT INTO "security".link_user_group_user_role (link_user_group_user_role_id,user_group_id,user_role_id,created) VALUES
				 ('bac491b1-ac1a-45eb-b2ae-e30b3db3ba65','22ee608b-dd9d-4633-906d-7c4efca231a0','68a81927-259d-4e2a-84d7-c565a9d0f943','2024-10-09 19:54:18.511239'),
				 ('e53640e7-4a56-4d68-8061-b4e3d4ec33c2','22ee608b-dd9d-4633-906d-7c4efca231a0','17c97647-f53c-400f-a700-ad349eeee0c3','2024-10-09 19:54:18.511239'),
				 ('69639956-38ff-4fc7-aee5-a6785fee3eae','22ee608b-dd9d-4633-906d-7c4efca231a0','726dc966-6832-4f5c-b867-2797259d5104','2024-10-09 19:54:18.511239'),
				 ('6b5dfc30-7a04-4d89-874d-02a549f51182','22ee608b-dd9d-4633-906d-7c4efca231a0','cc1ac346-71bf-4fa7-9300-78730a1bed08','2024-10-09 19:54:18.511239'),
				 ('91e65fc5-1691-4df3-99a7-2e7f93d779f8','22ee608b-dd9d-4633-906d-7c4efca231a0','65b50a78-4f68-4bd9-9836-4fb3e2fb2c6a','2024-10-09 19:54:18.511239'),
				 ('94d28392-6914-45ce-a090-690daa404f9d','22ee608b-dd9d-4633-906d-7c4efca231a0','767ae8cf-af01-44d4-86ef-fcb143373407','2024-10-09 19:54:18.511239') on conflict do nothing;
			INSERT INTO "security".link_user_group_user_role (link_user_group_user_role_id,user_group_id,user_role_id,created) VALUES
				 ('74611b2a-3641-4baf-899c-f69b46e56978','22ee608b-dd9d-4633-906d-7c4efca231a0','32f9413b-619a-4e4b-85f9-4c4699267b37','2024-10-09 19:54:18.511239'),
				 ('2f23c82b-3017-44ee-9e7f-b7b3efc88779','25d720ff-fa5e-41f2-bbe9-0db90187b0f4','17c97647-f53c-400f-a700-ad349eeee0c3','2024-10-09 20:47:31.439075'),
				 ('bc02b290-064c-4a86-9dd9-5611b0295045','25d720ff-fa5e-41f2-bbe9-0db90187b0f4','767ae8cf-af01-44d4-86ef-fcb143373407','2024-10-09 20:47:31.439075'),
				 ('10059011-1f42-4580-b92b-5d78c61d9f61','acf292b2-9b46-4bf2-9254-39696d26f02b','726dc966-6832-4f5c-b867-2797259d5104','2024-10-09 20:49:38.630003'),
				 ('c3374413-f190-48dc-b194-e6a1ae4355ae','acf292b2-9b46-4bf2-9254-39696d26f02b','767ae8cf-af01-44d4-86ef-fcb143373407','2024-10-09 20:49:38.630003'),
				 ('189018bf-9301-4818-8821-545328de6012','00fe3742-dbb3-4639-aabd-3a10050ecd9e','68a81927-259d-4e2a-84d7-c565a9d0f943','2024-10-09 20:51:03.650021'),
				 ('ce69bef0-5324-4c16-b151-cfc7b473ad7c','00fe3742-dbb3-4639-aabd-3a10050ecd9e','767ae8cf-af01-44d4-86ef-fcb143373407','2024-10-09 20:51:03.650021'),
				 ('aedec67b-7bac-4b96-8682-a6e2a1865b62','0c61996f-c1db-483e-8456-5a5a9dc6dcdd','30c92f56-439c-463d-829c-93bcbf6b64d1','2024-10-17 09:15:30.396222'),
				 ('a155dcc0-1c7a-440e-ae69-384da3628824','6428cb6d-2949-4570-85b5-4b81e33b19ff','720d8a2b-1b30-4002-9a44-8e531c86460c','2024-10-17 09:15:41.72115') on conflict do nothing;
        </sql>
    </changeSet>
	
	<changeSet id="0013" author="hairullin">
        <comment>insert values into "security".user_account</comment>
        <sql>
			INSERT INTO "security".user_account (user_account_id,email,first_name,last_name,middle_name,created,updated,"locked",org_unit_id,username,phone,email_confirmed,user_source,source_name) VALUES
				('67ed8a30-2596-4dad-a782-756c7dfc4c72','petrova@mail.ru','Анна','Петрова','Сергеевна','2024-10-17 13:51:05.996629+03','2024-10-17 15:42:39+03',false,'0068b57d-1272-467d-8cfd-fb3edb9ce430','petrova','9788554411',true,'LOCAL',NULL),
				('408ff49a-4004-43b5-b040-3ca4ae363d03','sidorov@mail.ru','Сидор','Сидоров','Сидорович','2024-10-17 15:49:45.512511+03','2024-10-17 15:50:58+03',false,'20f455d2-2908-4a86-8ab5-2e500f2f5544','sidorov',NULL,true,'LOCAL',NULL),
				('62a03ff4-4b62-435c-a2ff-f7dbe7df2a6d','semenov@mail.ru','Семен','Семенов','Семенович','2024-10-18 19:18:20.872589+03','2024-10-18 19:18:20.872589+03',false,'0068b57d-1272-467d-8cfd-fb3edb9ce430','semenov',NULL,true,'LOCAL',NULL),
				('4caa6156-3cfb-4ea5-aa42-d3ff6f10ff8c','ivanov@mail.ru','Иван','Иванов','Иванович','2024-10-17 13:50:04.067612+03','2024-10-17 15:46:34+03',false,'0068b57d-1272-467d-8cfd-fb3edb9ce430','ivanov','9172010203',true,'LOCAL',NULL) on conflict do nothing;
		</sql>
    </changeSet>
	
	<changeSet id="0014" author="hairullin">
        <comment>insert values into "security".simple_credentials</comment>
        <sql>
			INSERT INTO "security".simple_credentials (user_account_id,"password",password_expires,password_updated) VALUES
				('67ed8a30-2596-4dad-a782-756c7dfc4c72','$2a$11$bNNQ/5bLA5HMpJkjCt.4J.M37RR59tSjs/JJVwq6PVBFfGpF6MweO',NULL,'2024-10-17 10:51:05.996629'),
				('4caa6156-3cfb-4ea5-aa42-d3ff6f10ff8c','$2a$11$Fv1Pvx74a5lfVwtRVzoX2enm8fmXjN3ykUL6qMcSpC96C22X9qU/2',NULL,'2024-10-17 10:50:04.067612'),
				('408ff49a-4004-43b5-b040-3ca4ae363d03','$2a$11$xWAtGkq2VVcdd8c9GNFxn.JNyfts4./Q7QNgG1M75NTYj3OOufWhO',NULL,'2024-10-17 12:49:45.512511'),
				('62a03ff4-4b62-435c-a2ff-f7dbe7df2a6d','$2a$11$j/zVSO0ntFJe6q01798zl.xssDsJw4/w9mLpx72fQKHZ0hhxMeQD2',NULL,'2024-10-18 16:18:20.872589') on conflict do nothing;
		</sql>
    </changeSet>
	
	<changeSet id="0015" author="hairullin">
        <comment>insert values into "security".link_user_account_user_group</comment>
        <sql>
			INSERT INTO "security".link_user_account_user_group (link_user_account_user_group_id,user_account_id,user_group_id,created) VALUES
				('05b7e162-4e0f-4aeb-95dd-331d18416f67','4caa6156-3cfb-4ea5-aa42-d3ff6f10ff8c','acf292b2-9b46-4bf2-9254-39696d26f02b','2024-10-17 10:50:04.067612'),
				('d471f557-2816-4cab-874e-ff00fc93a3ed','4caa6156-3cfb-4ea5-aa42-d3ff6f10ff8c','0c61996f-c1db-483e-8456-5a5a9dc6dcdd','2024-10-17 10:50:04.067612'),
				('7357e22b-078c-473f-8aae-17c6b8fb8991','67ed8a30-2596-4dad-a782-756c7dfc4c72','6428cb6d-2949-4570-85b5-4b81e33b19ff','2024-10-17 10:51:05.996629'),
				('bb585230-93f9-4af5-8b7a-19a41303bce8','67ed8a30-2596-4dad-a782-756c7dfc4c72','25d720ff-fa5e-41f2-bbe9-0db90187b0f4','2024-10-17 12:42:38.639522') on conflict do nothing;
			INSERT INTO "security".link_user_account_user_group (link_user_account_user_group_id,user_account_id,user_group_id,created) VALUES
				('d5db495e-a051-4ed2-ba9e-1a6e7bba79d2','408ff49a-4004-43b5-b040-3ca4ae363d03','0c61996f-c1db-483e-8456-5a5a9dc6dcdd','2024-10-17 12:49:45.512511'),
				('092dea94-44a9-4872-9ee0-350c74fa449b','408ff49a-4004-43b5-b040-3ca4ae363d03','00fe3742-dbb3-4639-aabd-3a10050ecd9e','2024-10-17 12:50:58.22643'),
				('7c81cde4-6f72-42e0-be92-c4bb79cdd4e9','62a03ff4-4b62-435c-a2ff-f7dbe7df2a6d','6428cb6d-2949-4570-85b5-4b81e33b19ff','2024-10-18 16:18:20.872589'),
				('f3d7f57e-58ea-4509-8d58-fb0fd4600ecc','62a03ff4-4b62-435c-a2ff-f7dbe7df2a6d','25d720ff-fa5e-41f2-bbe9-0db90187b0f4','2024-10-18 16:18:20.872589') on conflict do nothing;
		</sql>
    </changeSet>
	
	<changeSet id="0016" author="hairullin">
        <comment>update in "security".user_role and "security".user_group</comment>
        <sql>
			update "security".user_role set name='Специалист ВК по воинскому учёту' where name='Сотрудник ВК';
			update "security".user_group set name='Специалист ВК по воинскому учёту' where name='Сотрудник ВК';
		</sql>
    </changeSet>
	
	<changeSet id="0017" author="hairullin">
        <comment>insert into "security".user_role and "security".user_group</comment>
        <sql>
			INSERT INTO "security".user_role (user_role_id,name,created,updated) VALUES
				('afbd6f7b-e7cd-4243-999b-b253e66ef0b2','Специалист ВК по комплектованию','2025-01-30 15:11:50.000','2025-01-30 15:11:50.000'),
				('14a06e26-3403-4ba7-a132-af25167ec33c','Специалист ВК по обработке заявлений','2025-01-30 15:12:08.000','2025-01-30 15:12:08.000') on conflict do nothing;
			INSERT INTO "security".user_group (user_group_id,name,created,updated,access_level_id) VALUES
				('c2743aa6-13af-4b71-bd45-b907fb7fdf60','Специалист ВК по обработке заявлений','2025-01-30 15:12:39.000','2025-01-30 15:12:39.000','a6bf4b31-6648-4095-b269-2a950b548a10'),
				('0a694c58-432c-4ce1-8184-e8041d27080c','Специалист ВК по комплектованию','2025-01-30 15:13:37.000','2025-01-30 15:13:37.000','a6bf4b31-6648-4095-b269-2a950b548a10') on conflict do nothing;
		</sql>
    </changeSet>
	
	<changeSet id="0018" author="hairullin">
        <comment>insert values into link_user_group_user_role</comment>
        <sql>
			INSERT INTO "security".link_user_group_user_role (link_user_group_user_role_id,user_group_id,user_role_id,created) VALUES
				('9789b25e-35e0-4962-b699-32d5143cebd3','c2743aa6-13af-4b71-bd45-b907fb7fdf60','14a06e26-3403-4ba7-a132-af25167ec33c','2025-01-30 12:12:39.064'),
				('c939824c-4d1d-42f5-8015-c54f2d78acd0','0a694c58-432c-4ce1-8184-e8041d27080c','afbd6f7b-e7cd-4243-999b-b253e66ef0b2','2025-01-30 12:13:36.961') on conflict do nothing;
		</sql>
    </changeSet>
	
	
	
	
</databaseChangeLog>