Schema API functions
Last updated on
13 October 2016
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
The Schema API defines a number of functions for manipulating the database schema. These functions all operate directly on the database at the time they are called. They are generally most useful in writing hook_update_N() functions which need to incrementally update a database from one schema to another.
A full list of Schema API functions is available here.
- db_add_field
- db_add_index
- db_add_primary_key
- db_add_unique_key
- db_change_field
- db_create_table
- db_drop_field
- db_drop_index
- db_drop_primary_key
- db_drop_table
- db_drop_unique_key
- db_field_set_default
- db_field_set_no_default
- db_rename_table
- drupal_get_schema
- drupal_get_schema_unprocessed
- drupal_install_schema
- drupal_uninstall_schema
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion