From db9e0e7d389a9d54ebd8f836f479301f4b9cbc96 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 11 Jul 2024 15:54:52 +0100 Subject: [PATCH] Fix fun flake in MySQL / MariaDB. --- packages/server/src/api/routes/tests/row.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/row.spec.ts b/packages/server/src/api/routes/tests/row.spec.ts index 9fc7fb05c1..96be59a7e1 100644 --- a/packages/server/src/api/routes/tests/row.spec.ts +++ b/packages/server/src/api/routes/tests/row.spec.ts @@ -819,7 +819,10 @@ describe.each([ const table = await config.api.table.save(tableRequest) const stringValue = generator.word() - const naturalValue = generator.integer({ min: 0, max: 1000 }) + + // MySQL and MariaDB auto-increment fields have a minimum value of 1. If + // you try to save a row with a value of 0 it will use 1 instead. + const naturalValue = generator.integer({ min: 1, max: 1000 }) const existing = await config.api.row.save(table._id!, { string: stringValue,