const [newSolution] = await db.transaction(async (tx) => {
await tx.update(csTable).set({ state: "archived" }).where(eq(csTable.state, "solved"));
return await tx.insert(csTable).values([newCollectiveSolution]).returning(collectiveSolutionsPublicCols);
});
const [newSolution] = await db.transaction(async (tx) => {
await tx.update(csTable).set({ state: "archived" }).where(eq(csTable.state, "solved"));
return await tx.insert(csTable).values([newCollectiveSolution]).returning(collectiveSolutionsPublicCols);
});