Skip to content

No change in db after the migration script ran #20

@phani50

Description

@phani50

Hi Team,

We are using agnostic to run all migration scripts (for mysql). As pert of this i have to drop a column if exists in table. for this i have added below script in migration file.

set @START_DATE_Check := (
select count(*) from information_schema.columns
where TABLE_NAME='COMMAND'
and COLUMN_NAME='START_DATE'
and TABLE_SCHEMA= 'ICPS'
) ;
set @sqlstmt := if(@START_DATE_Check > 0, 'alter table COMMAND drop column START_DATE', 'select "START_DATE does not exist in COMMAND" AS "Comment"') ;
prepare stmt from @sqlstmt ;
execute stmt ;

The above script working fine when i ran in mysql workbench, the column is removed if exists or else displayed the provided message.

Where as while running migration scripts by agnostic, there is no error and no impact on the table as well. (not removed the column).

Can you please help me here ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions