Skip to content

Commit

Permalink
feat: liquibase script
Browse files Browse the repository at this point in the history
  • Loading branch information
JordenReuter committed Apr 24, 2024
1 parent 2f956eb commit 8e12b58
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
15 changes: 15 additions & 0 deletions src/main/resources/db/24-04-2024-multi-tenancy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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-latest.xsd"
objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">
<changeSet author="dev (generated)" id="1713971154300-1">
<addColumn tableName="apm_app_param">
<column name="tenant_id" type="varchar(255 BYTE)">
<constraints nullable="false"/>
</column>
</addColumn>
<addUniqueConstraint columnNames="application_id, param_key, tenant_id" constraintName="app_id_param_key_tenant" tableName="apm_app_param"/>
<dropUniqueConstraint constraintName="app_id_param_key" tableName="apm_app_param"/>
</changeSet>
</databaseChangeLog>
2 changes: 2 additions & 0 deletions src/main/resources/db/changeLog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">

<include relativeToChangelogFile="true" file="createTables.xml"/>
<include relativeToChangelogFile="true" file="24-04-2024-multi-tenancy.xml"/>

</databaseChangeLog>
5 changes: 1 addition & 4 deletions src/main/resources/db/createTables.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
<column name="import_value" type="VARCHAR(255)"/>
<column name="set_value" type="VARCHAR(255)"/>
<column name="value_type" type="VARCHAR(255)"/>
<column name="tenant_id" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
</createTable>
<createTable tableName="apm_app_param_data">
<column name="guid" type="VARCHAR(255)">
Expand Down Expand Up @@ -78,7 +75,7 @@
</changeSet>

<changeSet author="dev (generated)" id="create-constraints">
<addUniqueConstraint columnNames="application_id, param_key, tenant_id" constraintName="app_id_param_key" tableName="apm_app_param"/>
<addUniqueConstraint columnNames="application_id, param_key" constraintName="app_id_param_key" tableName="apm_app_param"/>
<addUniqueConstraint columnNames="parameter_guid" constraintName="param_guid" tableName="apm_app_param_data"/>
</changeSet>

Expand Down

0 comments on commit 8e12b58

Please sign in to comment.