Simon
Simon
Explore posts from servers
DTDrizzle Team
Created by Simon on 2/8/2024 in #help
Alter type enum column ending in replace rather than alter
Warning Found data-loss statements:
· You're about to change type column type from enum('deposit','withdrawal','gameEntered','gameReward','inviteeReward') to enum('deposit','withdrawal','gameEntered','gameReward','inviteeReward','inviterReward') with 1973 items

THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED
Warning Found data-loss statements:
· You're about to change type column type from enum('deposit','withdrawal','gameEntered','gameReward','inviteeReward') to enum('deposit','withdrawal','gameEntered','gameReward','inviteeReward','inviterReward') with 1973 items

THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED
2 replies
DTDrizzle Team
Created by Simon on 2/1/2024 in #help
ON DUPLICATE KEY UPDATE with bulk insert?
got it, can use something like this
const insertResult = await db
.insert(leaderboard)
.values(allUsersWithData)
.onDuplicateKeyUpdate({
set: {
invitesCount: sql`VALUES(invitesCount)`,
},
})
const insertResult = await db
.insert(leaderboard)
.values(allUsersWithData)
.onDuplicateKeyUpdate({
set: {
invitesCount: sql`VALUES(invitesCount)`,
},
})
3 replies