Files
Starlight_Lancher/packages/app-lib/migrations/20261003000100_linked-server-project-sync-source.sql
T
AxTps 5a289c3a15
Sync source to CNB / Sync Git ref (push) Has been cancelled
feat(sync): 跨实例同步第1轮——同步功能表、InstanceSyncedOptions 类型与实例元数据字段
- 新增 4 个 migration:同步功能表/instance_servers 扩展/synced_pack_selection/禁用发现选项

- 新增 InstanceSyncedOptions 类型(per-instance 同步开关)

- InstanceMetadata 增加 synced_options 字段并在 3 个查询点填充

- instance_rows 新增 get_instance_synced_options

- 前端 GameInstance 增加 synced_options 类型
2026-10-03 21:08:05 +08:00

28 lines
1.0 KiB
SQL

-- Axolotl stores managed server-project entries alongside the local additions
-- that are composed with the launcher-wide multiplayer server list. Extend
-- the original sync table constraint without changing the already-applied
-- instance-sync migration.
CREATE TABLE instance_servers_new (
instance_id TEXT NOT NULL,
id TEXT NOT NULL,
source TEXT NOT NULL CHECK (
source IN ('modpack', 'linked_server_project', 'local_desynced')
),
excluded_synced_server_id TEXT,
nbt BLOB NOT NULL,
position INTEGER NOT NULL CHECK (position >= 0),
PRIMARY KEY (instance_id, id),
UNIQUE (instance_id, position),
FOREIGN KEY (instance_id) REFERENCES instances (id) ON DELETE CASCADE,
FOREIGN KEY (excluded_synced_server_id)
REFERENCES synced_servers (id) ON DELETE SET NULL
);
INSERT INTO instance_servers_new
(instance_id, id, source, excluded_synced_server_id, nbt, position)
SELECT instance_id, id, source, excluded_synced_server_id, nbt, position
FROM instance_servers;
DROP TABLE instance_servers;
ALTER TABLE instance_servers_new RENAME TO instance_servers;