mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-15 13:14:35 +00:00
fix: project ID conflict, and update on same session id (#15596)
This commit is contained in:
@@ -131,7 +131,14 @@ export const ImportCommand = cmd({
|
|||||||
return
|
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) {
|
for (const msg of exportData.messages) {
|
||||||
Database.use((db) =>
|
Database.use((db) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user