use 4dkankan_v4;
DELETE FROM sys_menu WHERE rec_status = 'I';

DELETE from sys_menu WHERE id = 225;
DELETE from sys_menu WHERE id = 99;
DELETE from sys_menu WHERE id = 104;
DELETE from sys_menu WHERE id = 16;
DELETE from sys_menu WHERE id = 23;
DELETE from sys_menu WHERE id = 21;
DELETE from sys_menu WHERE id = 96;
DELETE from sys_menu WHERE id = 247;
DELETE from sys_menu WHERE id = 18;
DELETE from sys_menu WHERE id = 24;
DELETE from sys_menu WHERE id = 20;

CREATE TEMPORARY TABLE temp_menu AS
SELECT id from sys_menu WHERE rec_status = 'A';
DELETE from sys_menu  WHERE parent_id not in (SELECT id from temp_menu);
DROP TEMPORARY TABLE temp_menu;

CREATE TEMPORARY TABLE temp_menu AS
SELECT id from sys_menu WHERE rec_status = 'A';
DELETE from sys_menu  WHERE parent_id not in (SELECT id from temp_menu);
DROP TEMPORARY TABLE temp_menu;

CREATE TEMPORARY TABLE temp_menu AS
SELECT id from sys_menu WHERE rec_status = 'A';
DELETE from sys_menu  WHERE parent_id not in (SELECT id from temp_menu);
DROP TEMPORARY TABLE temp_menu;


DELETE from sys_role_menu WHERE menu_id not in (SELECT id from sys_menu WHERE rec_status = 'A');


ALTER TABLE `4dkankan_v4`.`jy_scene_auth`
    ADD COLUMN `case_id` int NULL AFTER `update_time`;


ALTER TABLE `4dkankan_v4`.`jy_scene_user_auth`
    ADD COLUMN `case_id` int NULL AFTER `update_time`;


UPDATE t_scene_plus_ext set thumb = '/oss/loading/thumb.jpg' WHERE thumb LIKE '%https://4dkk.4dage.com/loading/thumb.jpg%'



USE fdkk_laser;

SET GLOBAL character_set_server = 'utf8mb4';
SET GLOBAL character_set_database = 'utf8mb4';
SET GLOBAL collation_server = 'utf8mb4_0900_ai_ci';

SELECT
    CONCAT('ALTER TABLE `', table_name, '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;') AS alter_sql
FROM
    information_schema.TABLES
WHERE
        table_schema = 'fdkk_laser';

