20250207_ERVU-273_create_db

This commit is contained in:
Makarova Elena 2025-02-10 15:24:43 +03:00
parent d8ed023ef3
commit 542d2237db
2 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,48 @@
<?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="e.makarova">
<comment>create_link_user_application_ip_address</comment>
<sql>
CREATE TABLE IF NOT EXISTS public.link_user_application_ip_address
(
link_user_application_ip_address_id bigserial,
user_application_list_id bigint NOT NULL,
ip_address character varying COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT pk_link_user_application_ip_address PRIMARY KEY (link_user_application_ip_address_id),
CONSTRAINT ip_address UNIQUE (user_application_list_id, ip_address),
CONSTRAINT fk1_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
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.link_user_application_ip_address
OWNER to ervu_account_applications;
GRANT ALL ON TABLE public.link_user_application_ip_address TO ervu_account_applications;
COMMENT ON TABLE public.link_user_application_ip_address
IS 'Таблица связи заявок и ip адрессов пользователя';
COMMENT ON COLUMN public.link_user_application_ip_address.user_application_list_id
IS 'Идентификатор списка заявок пользователя';
COMMENT ON COLUMN public.link_user_application_ip_address.ip_address
IS 'ip адресс';
</sql>
</changeSet>
<changeSet id="0002" author="e.makarova">
<comment>drop columns ip_address and ip_address_additional</comment>
<sql>
ALTER TABLE IF EXISTS public.user_application_list DROP COLUMN ip_address;
ALTER TABLE IF EXISTS public.user_application_list DROP COLUMN ip_address_additional;
</sql>
</changeSet>
</databaseChangeLog>

View file

@ -8,5 +8,7 @@
<include file="20241120-SUPPORT-8722_create_db.xml" relativeToChangelogFile="true"/>
<include file="20250205-ERVU-261_create_db.xml" relativeToChangelogFile="true"/>
<include file="20250207_user_account_email.xml" relativeToChangelogFile="true"/>
<include file="20250207_ERVU-273_create_db.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>