From 2a80789f1de5655c616939d107bfd4d2bc189f6b Mon Sep 17 00:00:00 2001 From: avsdev-cw Date: Tue, 6 Oct 2020 13:23:58 +0100 Subject: [PATCH] Auto increment ID for groups and users --- src/modb_manage_p.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modb_manage_p.c b/src/modb_manage_p.c index a93c4ba..51408c6 100644 --- a/src/modb_manage_p.c +++ b/src/modb_manage_p.c @@ -143,7 +143,7 @@ uint64_t createUsersTable(struct stored_conn_t *sconn, struct modb_t *modb) strbld_str(sb, "CREATE TABLE `", 0); modbTableName_sb(sb, modb, USERS_TABLE, STR_LEN(USERS_TABLE)); strbld_str(sb, "` (" - "`id` INT UNSIGNED NOT NULL, " + "`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, " "`username` VARCHAR(255) NOT NULL, " "`email` VARCHAR(255) NOT NULL, " "`created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " @@ -173,7 +173,7 @@ uint64_t createGroupsTable(struct stored_conn_t *sconn, struct modb_t *modb) strbld_str(sb, "CREATE TABLE `", 0); modbTableName_sb(sb, modb, GROUPS_TABLE, STR_LEN(GROUPS_TABLE)); strbld_str(sb, "` (" - "`id` INT UNSIGNED NOT NULL, " + "`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, " "`name` VARCHAR(255) NOT NULL, " "`created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, " "`updated` TIMESTAMP on update CURRENT_TIMESTAMP NULL DEFAULT NULL, "