CREATE PROCEDURE AddColumnsIfNotExists()
BEGIN
-- Alter table TOV_NotificationTest column isDeleted
if not exists (select COLUMN_NAME from information_schema.columns
where table_name='pratice.address'
and COLUMN_NAME ='isDeleted' and TABLE_SCHEMA = SCHEMA()) then
alter table `address` add column `isDeleted` boolean default false;
end if;
END;
why does if not exist is not working ? it is working fine in mySql workbench query editor
how to do this ?
I tried alternate ways to find the solution ,
I came to know wat part is not working maybe if not exist , or if (SOME CONDITION)