feat: Initial commit

This commit is contained in:
2025-11-20 17:37:54 +03:00
commit be8818b71f
27 changed files with 617 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================ -->
<!-- ВНИМАНИЕ: Этот файл НЕЛЬЗЯ никак модифицировать, -->
<!-- не перемещать и не удалять! -->
<!-- ============================================================ -->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet id="2025-11-05--0001-employee" author="anepretimov">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="employee"/>
</not>
</preConditions>
<createTable tableName="employee">
<column name="id" type="BIGINT" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
<column name="code" type="VARCHAR(100)">
<constraints nullable="false" unique="true"/>
</column>
<column name="photo_url" type="VARCHAR(100)"/>
</createTable>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================ -->
<!-- ВНИМАНИЕ: Этот файл НЕЛЬЗЯ никак модифицировать, -->
<!-- не перемещать и не удалять! -->
<!-- ============================================================ -->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet id="2025-11-05--0002-place" author="anepretimov">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="place"/>
</not>
</preConditions>
<createTable tableName="place">
<column name="id" type="BIGINT" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="place_name" type="VARCHAR(100)">
<constraints nullable="false" unique="true"/>
</column>
</createTable>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================ -->
<!-- ВНИМАНИЕ: Этот файл НЕЛЬЗЯ никак модифицировать, -->
<!-- не перемещать и не удалять! -->
<!-- ============================================================ -->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet id="2025-11-05--0003-booking" author="anepretimov">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="booking"/>
</not>
</preConditions>
<createTable tableName="booking">
<column name="id" type="BIGINT" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="date" type="DATE">
<constraints nullable="false"/>
</column>
<column name="employee_id" type="BIGINT">
<constraints nullable="false" foreignKeyName="fk_booking_employee" referencedTableName="employee"
referencedColumnNames="id"/>
</column>
<column name="place_id" type="BIGINT">
<constraints nullable="false" foreignKeyName="fk_booking_place" referencedTableName="place"
referencedColumnNames="id"/>
</column>
</createTable>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================ -->
<!-- ВНИМАНИЕ: Этот файл НЕЛЬЗЯ никак модифицировать, -->
<!-- не перемещать и не удалять! -->
<!-- ============================================================ -->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet id="2025-11-05--0001-employee-data" author="anepretimov">
<loadData tableName="employee" file="db.changelog/data/csv/DO_NOT_MODIFY--2025-11-05--0001-employee-data.csv"
separator=";"
quotchar='"'
encoding="UTF-8"/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================ -->
<!-- ВНИМАНИЕ: Этот файл НЕЛЬЗЯ никак модифицировать, -->
<!-- не перемещать и не удалять! -->
<!-- ============================================================ -->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet id="2025-11-05--0002-place-data" author="anepretimov">
<loadData tableName="place" file="db.changelog/data/csv/DO_NOT_MODIFY--2025-11-05--0002-place-data.csv"
separator=";"
quotchar='"'
encoding="UTF-8"/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================ -->
<!-- ВНИМАНИЕ: Этот файл НЕЛЬЗЯ никак модифицировать, -->
<!-- не перемещать и не удалять! -->
<!-- ============================================================ -->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet id="2025-11-05--0003-booking-data" author="anepretimov">
<loadData tableName="booking" file="db.changelog/data/csv/DO_NOT_MODIFY--2025-11-05--0003-booking-data.csv"
separator=";"
quotchar='"'
encoding="UTF-8"/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,5 @@
name;code;photo_url
Ivanov Ivan;1111;https://catalog-cdn.detmir.st/media/2fe02057f9915e72a378795d32c79ea9.jpeg
Petrov Petr;2222;https://catalog-cdn.detmir.st/media/2fe02057f9915e72a378795d32c79ea9.jpeg
Kozlov Oleg;3333;https://catalog-cdn.detmir.st/media/2fe02057f9915e72a378795d32c79ea9.jpeg
Smirnova Anna;4444;https://catalog-cdn.detmir.st/media/2fe02057f9915e72a378795d32c79ea9.jpeg
1 name code photo_url
2 Ivanov Ivan 1111 https://catalog-cdn.detmir.st/media/2fe02057f9915e72a378795d32c79ea9.jpeg
3 Petrov Petr 2222 https://catalog-cdn.detmir.st/media/2fe02057f9915e72a378795d32c79ea9.jpeg
4 Kozlov Oleg 3333 https://catalog-cdn.detmir.st/media/2fe02057f9915e72a378795d32c79ea9.jpeg
5 Smirnova Anna 4444 https://catalog-cdn.detmir.st/media/2fe02057f9915e72a378795d32c79ea9.jpeg

View File

@@ -0,0 +1,4 @@
place_name
K-19
M-16
T-1
1 place_name
2 K-19
3 M-16
4 T-1

View File

@@ -0,0 +1,3 @@
date;place_id;employee_id
2025-11-08;1;1
2025-11-10;2;2
1 date place_id employee_id
2 2025-11-08 1 1
3 2025-11-10 2 2

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================ -->
<!-- ВНИМАНИЕ: Этот файл НЕЛЬЗЯ никак модифицировать, -->
<!-- не перемещать и не удалять! -->
<!-- ============================================================ -->
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<include file="db.changelog/1/0/2025-11-05--0001-employee.xml"/>
<include file="db.changelog/1/0/2025-11-05--0002-place.xml"/>
<include file="db.changelog/1/0/2025-11-05--0003-booking.xml"/>
<include file="db.changelog/data/2025-11-05--0001-employee-data.xml"/>
<include file="db.changelog/data/2025-11-05--0002-place-data.xml"/>
<include file="db.changelog/data/2025-11-05--0003-booking-data.xml"/>
</databaseChangeLog>