Browse docs
Shops
Installation
The database storage and automatic legacy-file migration described here are available from 1.0.11.
Install current sky_base, select oxmysql in its configuration, and start the database,
framework and other configured integrations first:
ensure sky_base
ensure sky_shops
Shops creates its tables automatically through Sky.DB.Migrate. You do not need to import
import.sql manually or grant add_filesystem_permission sky_base write sky_shops.
The database user needs permission to create and alter tables and to read and write their data.
Updating an existing installation
- Stop
sky_shops. Back up its database tables and the existingdata/shops.json. - Replace the resource files, including
fxmanifest.lua, the completesourcefolder andconfig/shop_locations.lua. Restore your olddata/shops.jsonbefore the first start. - Start the resource and check for
[sky_shops] Legacy data migration completein the console. - Keep the old file as a backup. Later restarts load the database and do not import it again.
All saved shop entries are imported in their original order, including shop types, positions, NPC positions and headings. An invalid file or failed database transaction prevents startup without deleting the original file or committing part of the import. Fix the reported problem and restart. The tables must use InnoDB. Do not delete migration markers to repeat an import.
Configuration and new shops
Configure shop types, items, prices and interactions in config/config.lua.
On a fresh database without an old data/shops.json, the initial locations come from
config/shop_locations.lua. Changing that file later does not overwrite database locations.
Use the administrator command /createshop and select a shop type to save a new shop at your
current position. The shop is shown to players only after it has been saved in the database.