Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
SPRING_DATASOURCE_USERNAME: ledger
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-ledger}
KEYCLOAK_ISSUER_URI: http://localhost/realms/fincore
SPRING_LIQUIBASE_CONTEXTS: production,demo

payments:
build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import java.util.UUID

internal const val IMAGE = "postgres:17-alpine"
internal const val CHANGELOG = "db/changelog/db.changelog-master.yaml"
internal const val PRODUCTION_CONTEXT = "production"
internal const val ACTOR = "test"
internal const val CCY = "USD"
internal const val ASSET = "ASSET"
Expand Down Expand Up @@ -68,7 +69,7 @@ internal class LedgerSchemaTestDb(
val connection = DriverManager.getConnection(postgres.jdbcUrl, postgres.username, postgres.password)
val database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(JdbcConnection(connection))
Liquibase(CHANGELOG, ClassLoaderResourceAccessor(), database).use { liquibase ->
liquibase.update(Contexts(), LabelExpression())
liquibase.update(Contexts(PRODUCTION_CONTEXT), LabelExpression())
}
}

Expand Down
1 change: 1 addition & 0 deletions services/ledger/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spring:
ddl-auto: none
liquibase:
change-log: classpath:db/changelog/db.changelog-master.yaml
contexts: ${SPRING_LIQUIBASE_CONTEXTS:production}
security:
oauth2:
resourceserver:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ databaseChangeLog:
- include:
file: v0.1/021-outbox-events-leased-at.sql
relativeToChangelogFile: true
- include:
file: demo/001-demo-accounts.sql
relativeToChangelogFile: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--liquibase formatted sql
-- SPDX-License-Identifier: BUSL-1.1
-- SPDX-FileCopyrightText: 2026 FinCore Engine Authors

--changeset fincore:demo-001-accounts context:demo dbms:postgresql
INSERT INTO ledger.accounts (id, name, type, currency, created_by, updated_by) VALUES
('00000000-0000-0000-0000-000000000001', 'Customer Wallet USD', 'USER_WALLET', 'USD', 'demo-seed', 'demo-seed'),
('00000000-0000-0000-0000-000000000002', 'Customer Wallet EUR', 'USER_WALLET', 'EUR', 'demo-seed', 'demo-seed'),
('00000000-0000-0000-0000-000000000003', 'Platform Fee Income', 'FEE', 'USD', 'demo-seed', 'demo-seed'),
('00000000-0000-0000-0000-000000000004', 'Settlement Reserve', 'RESERVE', 'USD', 'demo-seed', 'demo-seed'),
('00000000-0000-0000-0000-000000000005', 'Suspense', 'SUSPENSE', 'USD', 'demo-seed', 'demo-seed')
ON CONFLICT (id) DO NOTHING;
Loading