mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
fix: project ID conflict, and update on same session id (#15596)
This commit is contained in:
parent
b1bfecb71d
commit
7bfbb1fcf8
@ -131,7 +131,14 @@ export const ImportCommand = cmd({
|
||||
return
|
||||
}
|
||||
|
||||
Database.use((db) => db.insert(SessionTable).values(Session.toRow(exportData.info)).onConflictDoNothing().run())
|
||||
const row = { ...Session.toRow(exportData.info), project_id: Instance.project.id }
|
||||
Database.use((db) =>
|
||||
db
|
||||
.insert(SessionTable)
|
||||
.values(row)
|
||||
.onConflictDoUpdate({ target: SessionTable.id, set: { project_id: row.project_id } })
|
||||
.run(),
|
||||
)
|
||||
|
||||
for (const msg of exportData.messages) {
|
||||
Database.use((db) =>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user