mirror of
https://github.com/AventurasTeam/Aventuras.git
synced 2026-04-28 11:50:15 +00:00
Renamed 025_preset_packs.sql → 030_preset_packs.sql and 030_pack_variable_extensions.sql → 031_pack_variable_extensions.sql to match their actual version numbers (30 and 31) in lib.rs, resolving the collision with 025_world_state_deltas.sql.
15 lines
631 B
SQL
15 lines
631 B
SQL
-- Add description and sort_order to pack variables, and custom_variable_values to stories
|
|
|
|
ALTER TABLE pack_variables ADD COLUMN description TEXT;
|
|
|
|
ALTER TABLE pack_variables ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0;
|
|
|
|
-- Initialize sort_order based on alphabetical position within each pack
|
|
UPDATE pack_variables SET sort_order = (
|
|
SELECT COUNT(*) FROM pack_variables pv2
|
|
WHERE pv2.pack_id = pack_variables.pack_id
|
|
AND pv2.variable_name < pack_variables.variable_name
|
|
);
|
|
|
|
-- Per-story custom variable value overrides (JSON object: { variableName: value })
|
|
ALTER TABLE stories ADD COLUMN custom_variable_values TEXT;
|