JG Docs
Vehicle Studio

Data Storage

Vehicle Studio can store its saved data in local resource files or in a MySQL database through oxmysql.

The data storage switch lives in config/config.lua:

Config.DataStorage = "local"

Valid values are:

ValueRequires oxmysqlBest for
"local"NoSimple installs, testing, single-server usage
"database"YesShared data, easier backups, production usage

Image uploads are configured separately with Config.ImageStorageProvider. Data storage decides where Vehicle Studio stores metadata such as vehicle image references, presets, and settings. It does not store preset thumbnails or generated image files in the database.

What Gets Stored

Vehicle Studio stores:

  • Vehicle gallery index data.
  • Image references and public image URLs.
  • Presets.
  • Preset thumbnail references.
  • Gallery settings.

Generated image files and preset thumbnail files use the configured image upload provider:

  • "local" saves files inside the resource.
  • "qbox", "fivemanage", "r2", and "s3" save files remotely and store the returned URL as a reference.

Local Storage

Local storage is the default option and does not require any database setup.

In config/config.lua:

Config.DataStorage = "local"

With local data storage, Vehicle Studio writes JSON data to a folder called local_data/ inside the resource.

Typical local data files include:

  • local_data/index.json
  • local_data/presets/index.json
  • local_data/presets/<preset-id>.json
  • local_data/settings.json

Use local storage if:

  • You want the simplest setup.
  • You do not want oxmysql as a dependency.
  • You are testing the resource locally.
  • You are only running one server instance.

Local Storage Notes

Do not commit your live config/ folder or generated data files. The resource includes config_example/ for defaults, while config/ is intended for your server-specific settings.

If you also use local image uploads, make sure you have followed the local image upload guide.

Database Storage

Database storage keeps Vehicle Studio data in MySQL through oxmysql.

In config/config.lua:

Config.DataStorage = "database"

You must also start oxmysql before Vehicle Studio in server.cfg:

ensure oxmysql
ensure jg-vehiclestudio

Vehicle Studio uses oxmysql exports, so oxmysql is only required when Config.DataStorage is set to "database".

Database Tables

The database schema lives in:

sql/jg_vehiclestudio.sql

That SQL file is the source of truth for both automatic setup and manual setup.

It creates these tables:

TablePurpose
jg_vehiclestudio_vehiclesVehicle entries in the gallery index
jg_vehiclestudio_imagesImage references for each vehicle
jg_vehiclestudio_presetsSaved preset data and summary fields
jg_vehiclestudio_settingsResource settings saved from the UI

Automatic Setup

When database storage is enabled, Vehicle Studio tries to run sql/jg_vehiclestudio.sql automatically on startup.

For automatic setup to work:

  1. oxmysql must be started.
  2. The MySQL connection must be valid.
  3. The configured database user must have permission to create tables.
  4. sql/jg_vehiclestudio.sql must be included with the resource.

Manual Setup

If automatic setup fails, manually run:

sql/jg_vehiclestudio.sql

Run it in your MySQL database using your preferred database tool, then restart Vehicle Studio.

Troubleshooting

On this page