♻️ 迁移数据而非清空

This commit is contained in:
目棃
2025-03-19 09:12:39 +08:00
parent 0aabd2fa80
commit 83d52c6f40

View File

@@ -31,7 +31,6 @@ create table if not exists UserAccount
updated text
);
drop table if exists GameAccount;
-- @brief 创建游戏账号数据表
create table if not exists GameAccount
(
@@ -48,6 +47,27 @@ create table if not exists GameAccount
primary key (uid, gameBiz, gameUid)
);
-- @brief 创建临时游戏账号数据表用于迁移数据
create table GameAccountTemp
(
uid text,
gameBiz text,
gameUid text,
isChosen boolean,
isOfficial boolean,
level integer,
nickname text,
region text,
regionName text,
updated text,
primary key (uid, gameBiz, gameUid)
);
--- @brief 迁移数据
insert into GameAccountTemp select * from GameAccount;
drop table GameAccount;
alter table GameAccountTemp rename to GameAccount;
-- @brief 创建深渊数据表
create table if not exists SpiralAbyss
(