You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
559 B

1 month ago
USE `data_center_new`;
DROP procedure IF EXISTS `add_column`;
DELIMITER $$
CREATE PROCEDURE add_column()
BEGIN
IF NOT EXISTS (
SELECT *
FROM information_schema.columns
WHERE table_schema = 'data_center_new'
AND table_name = 'basic_monitoring_asset'
AND column_name = 'external_file'
) THEN
ALTER TABLE basic_monitoring_asset
ADD COLUMN `external_file` text COMMENT '关联外部文件url';
END IF;
END$$
DELIMITER ;
CALL add_column();
DROP procedure IF EXISTS `add_column`;