Same name and namespace in other branches
  1. 6.x includes/database.pgsql.inc \db_drop_field()
  2. 6.x includes/database.mysql-common.inc \db_drop_field()
  3. 8.9.x core/includes/database.inc \db_drop_field()

Drops a field.

Parameters

$table: The table to be altered.

$field: The field to be dropped.

Related topics

18 calls to db_drop_field()
block_update_7008 in modules/block/block.install
Update database to match Drupal 7 schema.
comment_update_7006 in modules/comment/comment.install
Migrate data from the comment field to field storage.
field_sql_storage_update_7001 in modules/field/modules/field_sql_storage/field_sql_storage.install
Remove the field_config_entity_type table and store 'entity_type' strings.
filter_update_7005 in modules/filter/filter.install
Integrate text formats with the user permissions system.
node_update_7007 in modules/node/node.install
Remove column min_word_count.

... See full list

File

includes/database/database.inc, line 2988
Core systems for the database layer.

Code

function db_drop_field($table, $field) {
  return Database::getConnection()
    ->schema()
    ->dropField($table, $field);
}