fix(local): drop stress-test procedures from schema seed instead of gutting them
proc_create_user and proc_create_member generate users and members with a fixed password hash; they are removed whole. Every other routine and trigger is now kept intact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
e73fab9cc6
commit
edb45a1c30
1 file changed
+3
-71
@@ -1,5 +1,6 @@
|
||||
-- Local dev only. Table structure of the five Co-Lite service schemas, from a Tastefully
|
||||
-- schema dump (2026-11-26). Data rows, AUTO_INCREMENT counters and DEFINER users removed.
|
||||
-- Local dev only. Table structure, triggers and routines of the five Co-Lite service schemas,
|
||||
-- from a Tastefully schema-only dump (2026-11-26). AUTO_INCREMENT counters and DEFINER users removed.
|
||||
-- Stress-test procedures proc_create_user and proc_create_member removed (they create users with a fixed password).
|
||||
|
||||
USE `service-system`;
|
||||
-- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
|
||||
@@ -1576,30 +1577,6 @@ DELIMITER ;
|
||||
/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
CREATE PROCEDURE `proc_create_user`(IN startIndex INT, IN totalIN INT)
|
||||
BEGIN
|
||||
DECLARE v_count INTEGER DEFAULT 1;
|
||||
DECLARE usrid VARCHAR(25) DEFAULT '';
|
||||
DECLARE lastUsrId bigint(20) DEFAULT 1;
|
||||
|
||||
insert_usr: LOOP
|
||||
IF v_count > totalIN THEN
|
||||
LEAVE insert_usr;
|
||||
END IF;
|
||||
|
||||
SET usrid = concat('admin',v_count + startIndex);
|
||||
|
||||
|
||||
SET lastUsrId = LAST_INSERT_ID();
|
||||
|
||||
|
||||
SET v_count = v_count + 1;
|
||||
END LOOP insert_usr;
|
||||
|
||||
SELECT "Done" as Result;
|
||||
END ;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||
@@ -4871,51 +4848,6 @@ DELIMITER ;
|
||||
/*!50003 SET collation_connection = utf8mb3_general_ci */ ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO' */ ;
|
||||
DELIMITER ;;
|
||||
CREATE PROCEDURE `proc_create_member`(IN totalIN INT)
|
||||
BEGIN
|
||||
DECLARE v_count INTEGER DEFAULT 0;
|
||||
DECLARE mbid VARCHAR(25) DEFAULT '';
|
||||
DECLARE parentid VARCHAR(25) DEFAULT '';
|
||||
DECLARE mbidnum int DEFAULT 1;
|
||||
DECLARE parentidnum int DEFAULT 1;
|
||||
|
||||
insert_mbr: LOOP
|
||||
IF v_count = totalIN THEN
|
||||
LEAVE insert_mbr;
|
||||
END IF;
|
||||
|
||||
SET mbid = concat('MY',LPAD(mbidnum,8,0));
|
||||
|
||||
IF mbidnum = 1 THEN
|
||||
SET parentid = "ROOT";
|
||||
ELSE
|
||||
SET parentid = concat('MY',LPAD(parentidnum,8,0));
|
||||
END IF;
|
||||
|
||||
|
||||
SET v_count = v_count + 1;
|
||||
SET mbidnum = mbidnum + 1;
|
||||
|
||||
IF mbidnum < 20 THEN
|
||||
SET parentidnum = 1;
|
||||
ELSEIF mbidnum < 100 THEN
|
||||
SET parentidnum = mbidnum - FLOOR(RAND()*20) - 1;
|
||||
ELSEIF mbidnum < 500 THEN
|
||||
SET parentidnum = mbidnum - FLOOR(RAND()*50) - 1;
|
||||
ELSEIF mbidnum < 1500 THEN
|
||||
SET parentidnum = mbidnum - FLOOR(RAND()*150) - 1;
|
||||
ELSEIF mbidnum < 3500 THEN
|
||||
SET parentidnum = mbidnum - FLOOR(RAND()*350) - 1;
|
||||
ELSE
|
||||
SET parentidnum = mbidnum - FLOOR(RAND()*500) - 1;
|
||||
END IF;
|
||||
|
||||
END LOOP insert_mbr;
|
||||
|
||||
SELECT "Done" as Result;
|
||||
END ;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||
|
||||
Reference in new issue
Block a user