From 5260cfb7dacce5a0857e636b376597ba8e1bfe10 Mon Sep 17 00:00:00 2001 From: Wolvan Date: Wed, 12 Jan 2022 19:57:51 +0100 Subject: [PATCH] Remove unecessary ID column The strings are unique and do that job just fine. --- src/MySQLStorage.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/MySQLStorage.ts b/src/MySQLStorage.ts index 70b060a..7e3713e 100644 --- a/src/MySQLStorage.ts +++ b/src/MySQLStorage.ts @@ -26,8 +26,7 @@ export default class MySQLStorage extends Storage { async init(): Promise { await this.#db.promise().query(` CREATE TABLE IF NOT EXISTS polls ( - id INT AUTO_INCREMENT PRIMARY KEY, - id_str VARCHAR(32) NOT NULL UNIQUE, + id_str VARCHAR(32) NOT NULL PRIMARY KEY, title VARCHAR(${MAX_CHARACTER_LENGTH}) NOT NULL DEFAULT '', dupe_check_mode ENUM('none', 'ip', 'cookie') NOT NULL DEFAULT 'ip', multi_select TINYINT(1) NOT NULL DEFAULT 0,