🆙 Stage 1 of DB rebuild

This commit is contained in:
duckietm
2026-04-07 13:53:21 +02:00
parent 75b73df8dc
commit 46230d0709
11 changed files with 244 additions and 152 deletions
@@ -88,5 +88,10 @@ DROP PROCEDURE IF EXISTS `_add_id_pk_if_missing`;
DROP PROCEDURE IF EXISTS `_add_index_if_missing`;
DROP PROCEDURE IF EXISTS `_add_fk_if_missing`;
# Make sure thenb System account exists
INSERT INTO `users` (`id`, `username`, `password`, `ip_register`, `ip_current`, `motto`, `look`, `rank`, `credits`)
SELECT 0, '[SYSTEM]', '!', '127.0.0.1', '127.0.0.1', 'System sentinel - do not delete', '', 1, 0
WHERE NOT EXISTS (SELECT 1 FROM `users` WHERE `id` = 0);
SET FOREIGN_KEY_CHECKS = 1;
SET SQL_MODE = @OLD_SQL_MODE;