public function DatabaseSchema_sqlite::fieldExists

7.x schema.inc public DatabaseSchema_sqlite::fieldExists($table, $column)

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 drupal-7.x/includes/database/sqlite/schema.inc
Add a new field to a table.
DatabaseSchema_sqlite::changeField in drupal-7.x/includes/database/sqlite/schema.inc
Change a field definition.
DatabaseSchema_sqlite::dropField in drupal-7.x/includes/database/sqlite/schema.inc
Drop a field.
DatabaseSchema_sqlite::fieldSetDefault in drupal-7.x/includes/database/sqlite/schema.inc
Set the default value for a field.
DatabaseSchema_sqlite::fieldSetNoDefault in drupal-7.x/includes/database/sqlite/schema.inc
Set a field to have no default value.

File

drupal-7.x/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]);
}