You are here

public function DatabaseSchema_sqlite::fieldExists in Drupal 7

Check if a column exists in the given table.

Parameters

$table: The name of the table in drupal (no prefixing).

$name: The name of the column.

Return value

TRUE if the given column exists, otherwise FALSE.

Overrides DatabaseSchema::fieldExists

5 calls to DatabaseSchema_sqlite::fieldExists()
DatabaseSchema_sqlite::addField in includes/database/sqlite/schema.inc
Add a new field to a table.
DatabaseSchema_sqlite::changeField in includes/database/sqlite/schema.inc
Change a field definition.
DatabaseSchema_sqlite::dropField in includes/database/sqlite/schema.inc
Drop a field.
DatabaseSchema_sqlite::fieldSetDefault in includes/database/sqlite/schema.inc
Set the default value for a field.
DatabaseSchema_sqlite::fieldSetNoDefault in includes/database/sqlite/schema.inc
Set a field to have no default value.

File

includes/database/sqlite/schema.inc, line 28
Database schema code for SQLite databases.

Class

DatabaseSchema_sqlite

Code

public function fieldExists($table, $column) {
  $schema = $this
    ->introspectSchema($table);
  return !empty($schema['fields'][$column]);
}