I need to delete some old columns of existing table. How to do it using hook_update or Is there some other way to delete old columns in .install file .


1 Answer 1


You can use function db_drop_field()

 * Implements hook_update_N().
function mymodule_update_7001() {
  db_drop_field('my_table', 'my_column');
  • Could you give an example?
    – rooby
    Commented Apr 16, 2015 at 11:20
  • Yeah, I updated my post
    – Eugene
    Commented Apr 16, 2015 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.