Skip to content

Commit

Permalink
refactor: split database for write and read model.
Browse files Browse the repository at this point in the history
add schema of read database to flyway
Use root user on database for now.
  • Loading branch information
rafaelcp94 committed Apr 26, 2024
1 parent 3693cfc commit f90ca0d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class AccountOutAdapter(

jpaAccountOutAdapter.save(accountEntityMapper.toEntity(account))


return account
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/cqrs-meets-hexagonal
username: SA
username: root
password: Aut0mat0rs!
6 changes: 5 additions & 1 deletion demo-transactions/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ spring:
password: ${spring.datasource.password}
url: ${spring.datasource.url}
locations:
- classpath:db
- classpath:db/write
- classpath:db/read
schemas:
- cqrs-meets-hexagonal
- cqrs-meets-hexagonal-read-db

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE `cqrs-meets-hexagonal-read-db`.account_balance(
iban VARCHAR(255) NOT NULL,
balance DECIMAL NOT NULL,
PRIMARY KEY (iban)
);

0 comments on commit f90ca0d

Please sign in to comment.