Read how to update the database schema in Drupal 6 & 7 If your module is making a data model change related to database schema that your module defines with hook_schema(), then you need to properly update your data model.The two steps are: Sometimes your data model changes mean that you need to update the data within a table, rather than (or in addition to) changing the database schema itself.
One of the most common and challenging tasks for any application involves persisting and reading information to and from a database.
They might even remember to do it the very first time, but forget that it's all gone after running a relatively common command during development: .
This will cause an SQL error in some database engines.
Perform a schema validation, which consists of: a) Execute SQL statements to perform a reverse engineering in the database, retrieving the existing database schema (*).
b) Compare the existing schema with the target schema (all database objects - table, columns, etc. c) Provide info about the differences between the two schema (see schema validation for details).