sql - ERROR: cannot ALTER TABLE because it has pending trigger events while attempting to drop a column in a table -


i wrote sql tag in liquibase changeset. sql code suppose make data migration in table named "purchase". have following sql queries:

update purchase set location_id = (select location_id shop shop.id = purchase.shop_id); 

then,

alter table purchase drop column shop_id; 

but i'm getting following error while attempting execute second query that's supposed drop column 'shop_id' in table purchase

error: cannot alter table  because has pending trigger events 

please while error thrown , how can solve it.

in liquibase changese, sql tag written follow

<sql>      update purchase      set location_id = (select location_id shop shop.id = purchase.shop_id);               alter table purchase drop column shop_id; </sql 

please can me? thank's in advance help

sounds need commit changes between alter , update.

try this:

update purchase set location_id = (select location_id shop shop.id = purchase.shop_id); commit; begin; alter table purchase drop column shop_id; 

the "begin;" optional, sounds framework using transaction i'd include , test make sure alter "takes".


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -