SET FOREIGN_KEY_CHECKS=0;

ALTER TABLE `nbi_cm` ADD COLUMN IF NOT EXISTS `event_type` enum('ObjectCreationEvent','ObjectDeletionEvent','ObjectAttributeValueChangeEvent') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'ObjectCreationEvent' AFTER `rm_uid`;

ALTER TABLE `nbi_cm` MODIFY COLUMN `ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `ne_type`;

ALTER TABLE `nbi_cm` MODIFY COLUMN `value_json` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL AFTER `object_type`;

ALTER TABLE `nbi_cm` MODIFY COLUMN `timestamp` datetime NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP AFTER `value_json`;

ALTER TABLE `nbi_cm` DROP COLUMN IF EXISTS `time_zone`;

ALTER TABLE `nbi_cm` DROP COLUMN IF EXISTS `vendor_name`;

ALTER TABLE `nbi_cm` DROP COLUMN IF EXISTS `user_label`;

ALTER TABLE `nbi_cm` DROP COLUMN IF EXISTS `pv_flag`;

ALTER TABLE `nbi_cm` DROP COLUMN IF EXISTS `vm_id`;

ALTER TABLE `nbi_cm` DROP COLUMN IF EXISTS `vnf_instance_id`;

ALTER TABLE `nbi_cm` DROP COLUMN IF EXISTS `status`;

SET FOREIGN_KEY_CHECKS=1;