Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
1) liquibase folder structure moved to simple classic-like folder str…
Browse files Browse the repository at this point in the history
…ucture

2) tesler liquibase files are appended with "tesler" prefix now
3) liquibase master changelog file renamed to springboot default value "db.changelog-master"
4) liquibase changesets moved to 4.3 schema (=current tesler liquibase version)
5) ui meta for widgets is now grouped in folders with name equal to widget bc
  • Loading branch information
IgorNB committed Aug 23, 2021
1 parent b71df63 commit b3910da
Show file tree
Hide file tree
Showing 39 changed files with 2,670 additions and 25,349 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ app:
tesler:
meta:
dev-panel-enabled: ${DEV_PANEL_ENABLED:true}
directory: ${META_DIRECTORY:file:./src/main/resources/tesler/meta}
directory: ${META_DIRECTORY:file:./src/main/resources/meta}
view-allowed-roles-enabled: true
widget:
fields:
Expand All @@ -27,7 +27,7 @@ spring:
username: ${DATABASE_USER:postgres}
password: ${DATABASE_PASSWORD:postgres}
liquibase:
change-log: classpath:/db/migration/liquibase/master.xml
change-log: classpath:/db/db.changelog-master.xml
enabled: true
cache:
type: None
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"
logicalFilePath="db/migration/liquibase/initial/db_prepare.xml">
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd"
logicalFilePath="db/changelogdb_prepare.xml">

<changeSet runAlways="true" dbms="oracle" id="ORACLE CHAR SEMMANTICS" author="initial">
<sql>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"
logicalFilePath="db/migration/liquibase/initial/sequences.xml">
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd"
logicalFilePath="db/changelogsequences.xml">
<changeSet author="initial" id="APP_SEQ SEQUENCE">
<createSequence maxValue="9223372036854775807" sequenceName="APP_SEQ" startValue="1000000"/>
</changeSet>
Expand Down
2,539 changes: 2,539 additions & 0 deletions src/main/resources/db/changelog/0000300_tesler_core.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"
logicalFilePath="db/migration/liquibase/initial/quartz.xml">
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd"
logicalFilePath="db/changelog/0000400_tesler_quartz.xml">

<changeSet author="initial" id="QRTZ_BLOB_TRIGGERS TABLE">
<createTable tableName="QRTZ_BLOB_TRIGGERS">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<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.6.xsd"
logicalFilePath="db/migration/liquibase/latest/views/views.xml">
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd"
logicalFilePath="db/changelog/0000500_tesler_views.xml">

<changeSet author="latest" id="USER_DIVISIONS" dbms="oracle" runOnChange="true">
<sqlFile path="oracle/USER_DIVISIONS.sql" relativeToChangelogFile="true"/>
<sqlFile path="sql/TESLER-USER_DIVISIONS.sql" relativeToChangelogFile="true"/>
</changeSet>

</databaseChangeLog>
75 changes: 75 additions & 0 deletions src/main/resources/db/changelog/0000600.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd"
logicalFilePath="db/changelog/0000600.xml">

<changeSet id="main demo tables" author="ryalalov">
<createTable tableName="CLIENT">
<column name="ID" remarks="Identifier" type="NUMBER(19, 0)">
<constraints primaryKey="true"/>
</column>
<column defaultValueComputed="current_timestamp" name="CREATED_DATE" remarks="Creation date"
type="TIMESTAMP(6)">
<constraints nullable="false"/>
</column>
<column defaultValueComputed="current_timestamp" name="UPDATED_DATE" remarks="Last updated date"
type="TIMESTAMP(6)">
<constraints nullable="false"/>
</column>
<column defaultValueNumeric="1" name="CREATED_BY_USER_ID" type="NUMBER(19, 0)">
<constraints nullable="false" foreignKeyName="CLIENT_CREATED_BY" references="USERS"/>
</column>
<column defaultValueNumeric="1" name="LAST_UPD_BY_USER_ID" type="NUMBER(19, 0)">
<constraints nullable="false" foreignKeyName="CLIENT_LAST_UPD_BY" references="USERS"/>
</column>
<column defaultValueNumeric="0" name="VSTAMP" type="NUMBER(19, 0)">
<constraints nullable="false"/>
</column>
<column name="FULL_NAME" type="VARCHAR(200)"/>
<column name="DESCRIPTION" type="TEXT"/>
<column name="CITY" type="VARCHAR(50)"/>
<column name="STREET" type="VARCHAR(150)"/>
<column name="BUILDING" type="VARCHAR(50)"/>
<column name="IMPORTANCE" type="VARCHAR(20)"/>
<column name="STATUS" type="VARCHAR(20)"/>
</createTable>

<createTable tableName="CONTACT">
<column name="ID" remarks="Identifier" type="NUMBER(19, 0)">
<constraints primaryKey="true"/>
</column>
<column defaultValueComputed="current_timestamp" name="CREATED_DATE" remarks="Creation date"
type="TIMESTAMP(6)">
<constraints nullable="false"/>
</column>
<column defaultValueComputed="current_timestamp" name="UPDATED_DATE" remarks="Last updated date"
type="TIMESTAMP(6)">
<constraints nullable="false"/>
</column>
<column defaultValueNumeric="1" name="CREATED_BY_USER_ID" type="NUMBER(19, 0)">
<constraints nullable="false" foreignKeyName="CONTACT_CREATED_BY" references="USERS"/>
</column>
<column defaultValueNumeric="1" name="LAST_UPD_BY_USER_ID" type="NUMBER(19, 0)">
<constraints nullable="false" foreignKeyName="CONTACT_LAST_UPD_BY" references="USERS"/>
</column>
<column defaultValueNumeric="0" name="VSTAMP" type="NUMBER(19, 0)">
<constraints nullable="false"/>
</column>
<column name="FULL_NAME" type="VARCHAR(200)"/>
<column name="PHONE_NUMBER" type="VARCHAR(13)"/>
<column name="EMAIL" type="VARCHAR(50)"/>
<column name="CLIENT_ID" type="NUMBER(19, 0)">
<constraints foreignKeyName="REF_CLIENT" references="CLIENT"/>
</column>
</createTable>

<createTable tableName="FIELD_OF_ACTIVITY">
<column name="VALUE" type="VARCHAR(50)"/>
<column name="CLIENT_ID" type="NUMBER(19, 0)">
<constraints foreignKeyName="REF_CLIENT" references="CLIENT"/>
</column>
</createTable>
</changeSet>

</databaseChangeLog>
14 changes: 14 additions & 0 deletions src/main/resources/db/changelog/sql/TESLER-USER_DIVISIONS.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE OR REPLACE VIEW USER_DIVISIONS (USER_ID, DIVISIONS) AS
SELECT u.id AS user_id,
ud.divisions as divisions
FROM users u
left join
(SELECT STRING_AGG(full_name, ',') as divisions,
ur.id as user_id
FROM user_role ur,
division d
WHERE ur.division_id = d.id
group by ur.id
) ud
on u.id = ud.user_id;

7 changes: 7 additions & 0 deletions src/main/resources/db/db.changelog-master.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<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-4.3.xsd"
logicalFilePath="db/db.changelog-master.xml">
<includeAll path="changelog" relativeToChangelogFile="true"/>
</databaseChangeLog>
Loading

0 comments on commit b3910da

Please sign in to comment.