Database
Configure storage for sell history records.
Choosing a Backend
Pick based on your setup:
SQLite
File-based, zero config. Default. Best for single servers — no external database needed.
MySQL / MariaDB
Remote database. Use this if you run a network of servers and want shared history, or need external tools (dashboards, scripts) to query sell data.
Not sure? Use SQLite. You can always switch later — just be aware that history data is not migrated when changing backends.
SQLite
database.yml
data-storage-method: SQLite SQLite: file: 'TheBrewingMarket' table-prefix: 'tbm'
MySQL
database.yml
data-storage-method: MySQL
MySQL:
host: 'localhost'
port: '3306'
user: 'root'
password: 'password'
database: 'minecraft'
connection-parameters: '?useSSL=false&useUnicode=true&characterEncoding=UTF-8'
table-prefix: 'tbm'
Pool-Settings:
max-pool-size: 10
min-idle: 10
max-lifetime: 180000
keep-alive-time: 60000
time-out: 20000
Pool Settings
| Key | Default | Description |
|---|---|---|
max-pool-size | 10 | Max connections |
min-idle | 10 | Min idle connections |
max-lifetime | 180000 | Max connection lifetime (ms) |
keep-alive-time | 60000 | Keep-alive interval (ms) |
time-out | 20000 | Connection timeout (ms) |
MariaDB
Same structure as MySQL. Just change the storage method:
database.yml
data-storage-method: MariaDB
Table Schema
TheBrewingMarket creates {prefix}_sell_history with:
| Column | Type (MySQL) | Description |
|---|---|---|
id | BIGINT | Auto-increment PK |
player_uuid | VARCHAR(36) | Player UUID |
player_name | VARCHAR(32) | Player name |
recipe_id | TEXT | Recipe identifier |
display_name | TEXT | Brew display name (nullable) |
quality | DOUBLE | Quality score |
price_per | DOUBLE | Price per unit |
quantity | INT | Items sold |
total | DOUBLE | Total amount |
sold_at | BIGINT | Timestamp (epoch ms) |
SQLite: Uses
TEXT, REAL, and INTEGER equivalents instead of the MySQL types shown above.
Schema Migrations
TheBrewingMarket automatically migrates the database schema on startup. You do not need to run any SQL manually — existing data is always preserved.
| Version | Change |
|---|---|
v0 → v1 | Column recipe_name renamed to recipe_id. Separate indexes replaced with a single composite index on (player_uuid, sold_at DESC). |
Upgrading from an older version? Just restart the server — the migration runs automatically and your history data stays intact.
Note: Switching storage method does not migrate data between backends.