Documentation / EP-DrivingSchool

Database & EP-Identify integration

Tables

  • ep_driving_theory: owner, category, passed_at, score; persistent theory progress.
  • ep_driving_licenses: owner, category, framework, issued_at; qualifications.
  • ep_driving_cooldowns: owner, category, reason, expires_at; persistent retry/revocation cooldowns.

Manual schema

The supplied install/install.sql is optional if automatic setup succeeds. The exact schema from the reviewed package is:

sql
CREATE TABLE IF NOT EXISTS `ep_driving_theory` (
  `owner` varchar(80) NOT NULL, `category` varchar(50) NOT NULL,
  `passed_at` timestamp NOT NULL DEFAULT current_timestamp(), `score` tinyint unsigned NOT NULL,
  PRIMARY KEY (`owner`,`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `ep_driving_licenses` (
  `owner` varchar(80) NOT NULL, `category` varchar(50) NOT NULL, `framework` varchar(16) NOT NULL,
  `issued_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`owner`,`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `ep_driving_cooldowns` (
  `owner` varchar(80) NOT NULL, `category` varchar(50) NOT NULL, `reason` varchar(16) NOT NULL,
  `expires_at` bigint NOT NULL, PRIMARY KEY (`owner`,`category`,`reason`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

License storage

Config.LicenseStorage defaults to auto. QB/Qbox qualifications and theory-only boat categories write directly to ep_driving_licenses. For other frameworks, auto or ep-identify can call GrantDriverCategory when Identify is running; auto falls back to the database if the export does not succeed. Explicit ep-identify can fail if the export rejects a category. Set Identify's LicenseIntegration.source to ep_driving for the shared database. ESX may also read compatible user_licenses mappings when Identify is present.

Persistent identifiers

The two resources must agree on the permanent owner identifier; QB/Qbox use citizenid rather than the transient server ID or license: identifier. Test the card displays after an exam, after reconnect, and after revocation.

Database upgrades

The database-fix version widens existing category columns to 50 characters without dropping records. Give the database account ALTER permission as needed and back up first.

Login Required

You need to login with your CFX account before adding packages to your basket.