DUXPLIMA Documentation

The database

SQLite or MySQL, what is stored, and moving from one to the other.

Profiles, builder levels, jobs, warehouses, trust and the audit trail are stored in a database. SQLite works with no setup; MySQL is for networks or large servers.

Settings

KeyDefaultMeaning
database.typeAUTOSQLITE, MYSQL, or AUTO to decide from the URL
database.urljdbc:sqlite:./plugins/uxmBuilders/data/uxmbuilders.dbThe JDBC URL
database.username, passwordroot, emptyMySQL only
database.poolSize8MySQL connections
database.saveIntervalSeconds300How often running builds and warehouses are written
database.crashRecoverytrueAsk owners about unfinished builds after a restart

For MySQL:

database:
  type: 'AUTO'
  url: 'jdbc:mysql://localhost:3306/uxmbuilders'
  username: 'uxmbuilders'
  password: 'change_me_please'

MariaDB servers work through a jdbc:mysql:// URL. A jdbc:mariadb:// URL is refused with a message saying so, because the server ships the MySQL driver only.

What is stored

TableHolds
ub_playersSelected builder, total builds and blocks
ub_player_buildersOwned builders and their levels
ub_jobsEvery build: position, rotation, order, progress, price, refund, reason, boost
ub_warehouseMaterial balances
ub_trustedWho trusts whom
ub_auditPurchases, starts, cancels, refunds, boosts and trust changes, when logging.audit is on
ub_schema_versionThe schema version; upgrades are applied in order at startup

Writes from the build loop go through one background writer in order, so a slow disk never stalls a tick. State changes (complete, cancel) are written before money moves, so a crash between the two never refunds twice.

Moving from SQLite to MySQL

  1. Stop the server and keep a copy of data/uxmbuilders.db.
  2. Point database.url at MySQL and start the server. The plugin creates the schema there.
  3. Run /builders admin migrate sqlite-to-mysql.

It copies the old SQLite file into the live MySQL database. Rows already in MySQL, such as profiles of players who joined since the switch, are kept. It refuses to run if MySQL already holds builds, and it leaves the SQLite file untouched.

Notes

  • MySQL servers that require primary keys on every table, the default on several managed hosts, are supported.
  • data/ also holds license.cache, instance.id and pending-returns.yml. Delete none of them while the server runs.

Related: Restarts and refunds, config.yml