This commit is contained in:
seb
2026-09-22 07:25:16 +02:00
parent 4ed6260e91
commit cca131d83a
148 changed files with 5343 additions and 3466 deletions

View File

@@ -44,3 +44,14 @@ OUTPUT INSERTED.id, INSERTED.[type], INSERTED.prefix, INSERTED.padding, INSERTED
WHERE id = @id
AND company_id = @companyId
`;
export const GET_FOR_UPDATE = `
SELECT id, [type], prefix, padding, [next] AS [next]
FROM numbers WITH (UPDLOCK, ROWLOCK)
WHERE company_id = @companyId AND [type] = @type;
`;
export const INCREMENT = `
UPDATE numbers SET [next] = [next] + 1 WHERE id = @id;
`;