Database Configuration
Firmiana uses an embedded H2 database with Flyway for schema management.
Datasource Configuration
Environment Variable Overrides
H2 Modes
File Mode (Production Default)
Data persists to ./data/matrix.mv.db. The DB_CLOSE_DELAY=-1 parameter keeps the database open while the JVM runs.
In-Memory Mode (Testing)
Or override the datasource URL:
Data is lost when the JVM stops. Used in test classes with @Property(name = "datasources.default.url", value = "jdbc:h2:mem:testdb").
Connection Pool
HikariCP manages the connection pool:
H2 Web Console
The H2 web console is disabled by default:
Enable for development:
Access at http://localhost:8082 with JDBC URL jdbc:h2:./data/matrix.
Legacy Schema Initializer
H2SchemaInitializer contains the full DDL but is disabled by default:
It exists for reference and backward compatibility. Always prefer Flyway migrations.
Data Directory
The database file lives under ./data/matrix (gitignored). Stale local state can affect manual tests. To reset:
Deleting the database file removes all data. Back up before resetting.