sultan
sultan

Reputation: 6058

Drupal: module update alter database table

Please give a little tour on how to write module updates to provide altering of existing database tables. How to do this?

Sultan

Upvotes: 1

Views: 3024

Answers (2)

Adaddinsane
Adaddinsane

Reputation: 535

Jurgason's answer is good - I'd just add that the hook_install function should contain all the updates as well because, when freshly installing a module, Drupal does not run the update functions, it assumes they've already been included in the schema.

Upvotes: 2

Jamison Dance
Jamison Dance

Reputation: 20184

See this guide on drupal.org. It is a good overview of how to do it.

Upvotes: 4

Related Questions