add LIMIT 1 to our updates, out of healthy fear
This is just me thinking about what could go wrong in the modeling rollout, this at least makes it so that, if something breaks, it will break small
This commit is contained in:
parent
cc5a8a6fab
commit
94f6363251
2 changed files with 7 additions and 7 deletions
|
@ -1035,7 +1035,7 @@ Array [
|
|||
],
|
||||
],
|
||||
Array [
|
||||
"UPDATE items SET rarity_index = ?, thumbnail_url = ?, updated_at = ?, zones_restrict = ? WHERE id = ?;",
|
||||
"UPDATE items SET rarity_index = ?, thumbnail_url = ?, updated_at = ?, zones_restrict = ? WHERE id = ? LIMIT 1;",
|
||||
Array [
|
||||
500,
|
||||
"http://images.neopets.com/items/mall_staff_jewelled.gif",
|
||||
|
@ -1045,7 +1045,7 @@ Array [
|
|||
],
|
||||
],
|
||||
Array [
|
||||
"UPDATE item_translations SET description = ?, name = ?, updated_at = ? WHERE item_id = ? AND locale = \\"en\\";",
|
||||
"UPDATE item_translations SET description = ?, name = ?, updated_at = ? WHERE item_id = ? AND locale = \\"en\\" LIMIT 1;",
|
||||
Array [
|
||||
"This jewelled staff shines with a magical light.",
|
||||
"Jewelled Staff",
|
||||
|
@ -1466,7 +1466,7 @@ Array [
|
|||
],
|
||||
],
|
||||
Array [
|
||||
"UPDATE swf_assets SET body_id = ? WHERE type = ? AND remote_id = ?;",
|
||||
"UPDATE swf_assets SET body_id = ? WHERE type = ? AND remote_id = ? LIMIT 1;",
|
||||
Array [
|
||||
"0",
|
||||
"object",
|
||||
|
|
|
@ -488,10 +488,10 @@ async function syncToDb(
|
|||
const qs = columnNames.map((c) => `${c} = ?`).join(", ");
|
||||
const [conditionQs, ...conditionValues] = buildUpdateCondition(incomingRow);
|
||||
updatePromises.push(
|
||||
db.execute(`UPDATE ${tableName} SET ${qs} WHERE ${conditionQs};`, [
|
||||
...rowValues,
|
||||
...conditionValues,
|
||||
])
|
||||
db.execute(
|
||||
`UPDATE ${tableName} SET ${qs} WHERE ${conditionQs} LIMIT 1;`,
|
||||
[...rowValues, ...conditionValues]
|
||||
)
|
||||
);
|
||||
}
|
||||
await Promise.all(updatePromises);
|
||||
|
|
Loading…
Reference in a new issue