diff --git a/docker-compose.yml b/docker-compose.yml index d37304e..4e84afc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,7 +25,7 @@ services: - $DEBUG_PORT:$DEBUG_PORT environment: SPRING_APPLICATION_JSON: '{ - "spring.datasource.url" : "jdbc:mysql://mysqldb:$MYSQL_DOCKER_PORT/$MYSQL_DATABASE?serverTimezone=UTC", + "spring.datasource.url" : "jdbc:mysql://mysqldb:3306/$MYSQL_DATABASE?createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC", "spring.datasource.username" : "$MYSQL_USER", "spring.datasource.password" : "$MYSQL_PASSWORD", "spring.datasource.driver-class-name" : "com.mysql.cj.jdbc.Driver", diff --git a/src/main/resources/db/changelog/changes/14-set-shopping-cart-to-existing-user.yaml b/src/main/resources/db/changelog/changes/14-set-shopping-cart-to-existing-user.yaml new file mode 100644 index 0000000..cbc3479 --- /dev/null +++ b/src/main/resources/db/changelog/changes/14-set-shopping-cart-to-existing-user.yaml @@ -0,0 +1,27 @@ +databaseChangeLog: + - changeSet: + id: 1-add-shopping-cart-to-default-user + author: antonbabych + changes: + - insert: + tableName: shopping_cards + columns: + - column: + name: user_id + valueNumeric: 1 + - column: + name: is_deleted + value: 0 + - changeSet: + id: 2-add-shopping-cart-to-default-admin + author: antonbabych + changes: + - insert: + tableName: shopping_cards + columns: + - column: + name: user_id + valueNumeric: 2 + - column: + name: is_deleted + value: 0 diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index 9f3a66a..6d7d530 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -24,4 +24,6 @@ databaseChangeLog: - include: file: db/changelog/changes/12-create-order-table.yaml - include: - file: db/changelog/changes/13-create-order-item-table.yaml \ No newline at end of file + file: db/changelog/changes/13-create-order-item-table.yaml + - include: + file: db/changelog/changes/14-set-shopping-cart-to-existing-user.yaml \ No newline at end of file diff --git a/src/test/java/store/bookstoreapp/BookStoreAppApplicationTests.java b/src/test/java/store/bookstoreapp/BookStoreAppApplicationTests.java index 8352eb4..c948d3e 100644 --- a/src/test/java/store/bookstoreapp/BookStoreAppApplicationTests.java +++ b/src/test/java/store/bookstoreapp/BookStoreAppApplicationTests.java @@ -1,8 +1,12 @@ package store.bookstoreapp; +import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class BookStoreAppApplicationTests { + @Test + void contextLoads(){ + } }