13072-DROP id_usuario_destino FROM tmensajes if exists

This commit is contained in:
Pablo Aragon 2024-04-01 08:17:58 +02:00
parent 3820b668e9
commit 5e273db908

View File

@ -0,0 +1,8 @@
START TRANSACTION;
SET @exist = (SELECT count(*) FROM information_schema.columns WHERE TABLE_NAME='tmensajes' AND COLUMN_NAME='id_usuario_destino' AND table_schema = DATABASE());
SET @sqlstmt = IF (@exist>0, 'ALTER TABLE `tmensajes` DROP COLUMN `id_usuario_destino`', 'SELECT ""');
prepare stmt from @sqlstmt;
execute stmt;
COMMIT;