You are here

public function DatabaseSchema_sqlsrv::dropField in Drupal driver for SQL Server and SQL Azure 7.2

Same name and namespace in other branches
  1. 7.3 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::dropField()
  2. 7 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::dropField()

Override DatabaseSchema::dropField().

@status complete

Overrides DatabaseSchema::dropField

3 calls to DatabaseSchema_sqlsrv::dropField()
DatabaseSchema_sqlsrv::changeField in sqlsrv/schema.inc
Override DatabaseSchema::changeField().
DatabaseSchema_sqlsrv::cleanUpPrimaryKey in sqlsrv/schema.inc
Drop the primary key constraint.
DatabaseSchema_sqlsrv::cleanUpTechnicalPrimaryColumn in sqlsrv/schema.inc
Tries to clean up the technical primary column. It will be deleted if (a) It is not being used as the current primary key and... (b) There is no unique constraint because they depend on this column (see addUniqueKey())

File

sqlsrv/schema.inc, line 1381
Database schema code for Microsoft SQL Server database servers.

Class

DatabaseSchema_sqlsrv

Code

public function dropField($table, $field) {
  if (!$this
    ->fieldExists($table, $field)) {
    return FALSE;
  }

  // Drop the related objects.
  $this
    ->dropFieldRelatedObjects($table, $field);
  $this->connection
    ->query_direct('ALTER TABLE {' . $table . '} DROP COLUMN ' . $field);

  // Clear introspection cache.
  $this
    ->queryColumnInformationInvalidate($table);
  return TRUE;
}