From 59ab557a937a2d91ce3375a84aa23e76f7a1ff00 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 26 Feb 2024 18:29:57 +0000 Subject: [PATCH] Looping characters used. --- packages/server/src/api/controllers/row/alias.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/alias.ts b/packages/server/src/api/controllers/row/alias.ts index ca144ee518..05a261af42 100644 --- a/packages/server/src/api/controllers/row/alias.ts +++ b/packages/server/src/api/controllers/row/alias.ts @@ -28,7 +28,13 @@ export default class AliasTables { const char = this.character this.aliases[tableName] = char this.tableAliases[char] = tableName - this.character = String.fromCharCode(char.charCodeAt(0) + 1) + this.character = + char.substring(0, char.length - 1) + + String.fromCharCode(char.charCodeAt(char.length - 1) + 1) + // reached end of characters, extend number of characters used + if (this.character === "z") { + this.character = new Array(this.character.length + 1).fill("a").join("") + } return char }