You are here

public function DatabaseSchema_sqlsrv::fieldSetNoDefault in Drupal driver for SQL Server and SQL Azure 7

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

Override DatabaseSchema::fieldSetNoDefault().

@status complete

Overrides DatabaseSchema::fieldSetNoDefault

1 call to DatabaseSchema_sqlsrv::fieldSetNoDefault()
DatabaseSchema_sqlsrv::fieldSetDefault in sqlsrv/schema.inc
Override DatabaseSchema::fieldSetDefault().

File

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

Class

DatabaseSchema_sqlsrv

Code

public function fieldSetNoDefault($table, $field) {
  if (!$this
    ->fieldExists($table, $field)) {
    throw new DatabaseSchemaObjectDoesNotExistException(t("Cannot remove default value of field %table.%field: field doesn't exist.", array(
      '%table' => $table,
      '%field' => $field,
    )));
  }
  $this->connection
    ->query('ALTER TABLE [{' . $table . '}] DROP CONSTRAINT {' . $table . '}_' . $field . '_df');
}