mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🐛 fix(sql): 根据实际情况进行修正
This commit is contained in:
@@ -143,8 +143,8 @@ async function getBindRoleV2 () {
|
|||||||
bindRole.map(async (role: BTMuli.User.Game.Account) => {
|
bindRole.map(async (role: BTMuli.User.Game.Account) => {
|
||||||
const sql = `
|
const sql = `
|
||||||
INSERT INTO GameAccount (gameBiz, gameUid, isChosen, isOfficial, level, nickname, region, regionName, updated)
|
INSERT INTO GameAccount (gameBiz, gameUid, isChosen, isOfficial, level, nickname, region, regionName, updated)
|
||||||
Values ('${role.game_biz}', '${role.game_uid}', ${role.is_chosen ? 1 : 0}, ${role.is_official ? 1 : 0}, '${role.level}', '${role.nickname}', '${role.region}', '${role.region_name}', datetime('now', 'localtime')
|
VALUES ('${role.game_biz}', '${role.game_uid}', ${role.is_chosen ? 1 : 0}, ${role.is_official ? 1 : 0}, '${role.level}', '${role.nickname}', '${role.region}', '${role.region_name}', datetime('now', 'localtime'))
|
||||||
ON CONFILCT (gameBiz, gameUid) DO UPDATE SET
|
ON CONFLICT (gameBiz, gameUid) DO UPDATE SET
|
||||||
isChosen = ${role.is_chosen ? 1 : 0},
|
isChosen = ${role.is_chosen ? 1 : 0},
|
||||||
isOfficial = ${role.is_official ? 1 : 0},
|
isOfficial = ${role.is_official ? 1 : 0},
|
||||||
level = '${role.level}',
|
level = '${role.level}',
|
||||||
|
|||||||
@@ -40,16 +40,16 @@ function initGameAccountTable (): string[] {
|
|||||||
sqlRes.push(`
|
sqlRes.push(`
|
||||||
CREATE TABLE IF NOT EXISTS GameAccount
|
CREATE TABLE IF NOT EXISTS GameAccount
|
||||||
(
|
(
|
||||||
gameBiz TEXT PRIMARY KEY,
|
gameBiz TEXT NOT NULL,
|
||||||
gameUid TEXT DEFAULT NULL,
|
gameUid TEXT NOT NULL,
|
||||||
isChosen BOOLEAN DEFAULT 0,
|
isChosen BOOLEAN DEFAULT 0,
|
||||||
isOfficial BOOLEAN DEFAULT 0,
|
isOfficial BOOLEAN DEFAULT 0,
|
||||||
level INTEGER DEFAULT 0,
|
level INTEGER DEFAULT 0,
|
||||||
nickname TEXT DEFAULT NULL,
|
nickname TEXT DEFAULT NULL,
|
||||||
region TEXT DEFAULT NULL,
|
region TEXT DEFAULT NULL,
|
||||||
regionName TEXT DEFAULT NULL,
|
regionName TEXT DEFAULT NULL,
|
||||||
updated TEXT DEFAULT NULL,
|
updated TEXT DEFAULT NULL,
|
||||||
PRIMARY KEY (gameBiz, gameUid)
|
PRIMARY KEY (gameBiz, gameUid)
|
||||||
);
|
);
|
||||||
`);
|
`);
|
||||||
return sqlRes;
|
return sqlRes;
|
||||||
|
|||||||
Reference in New Issue
Block a user