-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#10] Convert Liquibase scripts to XML format
- Loading branch information
Showing
25 changed files
with
152 additions
and
134 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...training/store/api/BalanceController.java → ...raining/store/rest/BalanceController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...aining/store/api/ExistenceController.java → ...ining/store/rest/ExistenceController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...8ai/training/store/api/LotController.java → ...ai/training/store/rest/LotController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ai/training/store/api/PackController.java → ...i/training/store/rest/PackController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...training/store/api/ProductController.java → ...raining/store/rest/ProductController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ai/training/store/api/SaleController.java → ...i/training/store/rest/SaleController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ai/training/store/api/ShopController.java → ...i/training/store/rest/ShopController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
src/main/java/com/i8ai/training/store/util/DateTimeUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
package com.i8ai.training.store.util; | ||
|
||
import lombok.experimental.UtilityClass; | ||
|
||
import java.util.Date; | ||
|
||
@UtilityClass | ||
public class DateTimeUtils { | ||
|
||
private DateTimeUtils() { | ||
} | ||
|
||
public static Date dateOrMin(Date start) { | ||
public Date dateOrMin(Date start) { | ||
return start != null ? start : new Date(0); | ||
} | ||
|
||
public static Date dateOrMax(Date end) { | ||
public Date dateOrMax(Date end) { | ||
return end != null ? end : new Date(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
spring: | ||
profiles: | ||
active: prod | ||
application: | ||
name: product-store-api | ||
|
||
liquibase: | ||
change-log: classpath:/db/changelog/db.changelog-master.yml | ||
change-log: classpath:/db/changelog-master.xml | ||
user: ${spring.datasource.username} | ||
password: ${spring.datasource.password} | ||
|
||
profiles: | ||
active: prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?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-4.27.xsd"> | ||
|
||
<include file="db/init-changelog.xml"/> | ||
|
||
</databaseChangeLog> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?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-4.27.xsd" | ||
objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS"> | ||
<changeSet id="init" author="Isbel"> | ||
<createTable tableName="lot"> | ||
<column autoIncrement="true" name="id" type="BIGINT"> | ||
<constraints nullable="false" primaryKey="true" primaryKeyName="pk_lot"/> | ||
</column> | ||
<column name="received" type="DATETIME"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="amount" type="DOUBLE"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="cost" type="DOUBLE"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="product_id" type="BIGINT"> | ||
<constraints nullable="false"/> | ||
</column> | ||
</createTable> | ||
|
||
<createTable tableName="pack"> | ||
<column autoIncrement="true" name="id" type="BIGINT"> | ||
<constraints nullable="false" primaryKey="true" primaryKeyName="pk_pack"/> | ||
</column> | ||
<column name="delivered" type="DATETIME"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="amount" type="DOUBLE"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="lot_id" type="BIGINT"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="shop_id" type="BIGINT"> | ||
<constraints nullable="false"/> | ||
</column> | ||
</createTable> | ||
|
||
<createTable tableName="product"> | ||
<column autoIncrement="true" name="id" type="BIGINT"> | ||
<constraints nullable="false" primaryKey="true" primaryKeyName="pk_product"/> | ||
</column> | ||
<column name="code" type="VARCHAR(255)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="name" type="VARCHAR(255)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="measure" type="VARCHAR(255)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="description" type="VARCHAR(255)"/> | ||
</createTable> | ||
|
||
<createTable tableName="sale"> | ||
<column autoIncrement="true" name="id" type="BIGINT"> | ||
<constraints nullable="false" primaryKey="true" primaryKeyName="pk_sale"/> | ||
</column> | ||
<column name="registered" type="DATETIME"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="amount" type="DOUBLE"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="price" type="DOUBLE"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="pack_id" type="BIGINT"> | ||
<constraints nullable="false"/> | ||
</column> | ||
</createTable> | ||
|
||
<createTable tableName="shop"> | ||
<column autoIncrement="true" name="id" type="BIGINT"> | ||
<constraints nullable="false" primaryKey="true" primaryKeyName="pk_shop"/> | ||
</column> | ||
<column name="name" type="VARCHAR(255)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="address" type="VARCHAR(255)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="description" type="VARCHAR(255)"/> | ||
</createTable> | ||
|
||
<addUniqueConstraint columnNames="code" constraintName="uc_product_code" tableName="product"/> | ||
|
||
<addForeignKeyConstraint baseColumnNames="product_id" baseTableName="lot" constraintName="FK_LOT_ON_PRODUCT" | ||
referencedColumnNames="id" referencedTableName="product"/> | ||
|
||
<addForeignKeyConstraint baseColumnNames="lot_id" baseTableName="pack" constraintName="FK_PACK_ON_LOT" | ||
referencedColumnNames="id" referencedTableName="lot"/> | ||
|
||
<addForeignKeyConstraint baseColumnNames="shop_id" baseTableName="pack" constraintName="FK_PACK_ON_SHOP" | ||
referencedColumnNames="id" referencedTableName="shop"/> | ||
|
||
<addForeignKeyConstraint baseColumnNames="pack_id" baseTableName="sale" constraintName="FK_SALE_ON_PACK" | ||
referencedColumnNames="id" referencedTableName="pack"/> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ning/store/api/BalanceControllerTest.java → ...ing/store/rest/BalanceControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ng/store/api/ExistenceControllerTest.java → ...g/store/rest/ExistenceControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...training/store/api/LotControllerTest.java → ...raining/store/rest/LotControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...raining/store/api/PackControllerTest.java → ...aining/store/rest/PackControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ning/store/api/ProductControllerTest.java → ...ing/store/rest/ProductControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...raining/store/api/SaleControllerTest.java → ...aining/store/rest/SaleControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...raining/store/api/ShopControllerTest.java → ...aining/store/rest/ShopControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
spring: | ||
datasource: | ||
url: jdbc:h2:mem:dev;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;AUTO_RECONNECT=TRUE;MODE=PostgreSQL; | ||
url: jdbc:h2:mem:test;MODE=PostgreSQL; | ||
|
||
liquibase: | ||
enabled: false | ||
enabled: false | ||
|
||
profiles: | ||
active: test |