DELIMITER $$
DROP PROCEDURE IF EXISTS loopInsert$$
CREATE PROCEDURE loopInsert()
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i <= 50 DO
if i <= 25 then
INSERT INTO performance(description , performance_type, place , title, show_category, star_score, start_date, updated_date, ticket_end_date, ticket_open_date, created_date, end_date, musical_date_time)
VALUES(concat('dummy 공연 입니다',i), 'MUSICAL', '서울', '세상의 가수들 브루스리 휘성', 'AD', 3, now(), now(), now(), now(), now(), now(), '2023-03-28~2023-03-28');
else
INSERT INTO performance(description , performance_type, place , title, show_category, star_score, start_date, updated_date, ticket_end_date, ticket_open_date, created_date, end_date, musical_date_time)
VALUES(concat('dummy 공연 입니다',i),'CONCERT', '경주', '신구와 게맛살버거', 'NORMAL', 5, now(), now(), now(), now(), now(), now(), '2023-03-28~2023-03-28');
end if;
SET i = i + 1;
END WHILE;
END$$
DELIMITER $$
CALL loopInsert;
commit ;
테스트용 데이터를 넣기 위한 프로시저