You are here

public function Schema::fieldSetNoDefault in Drupal driver for SQL Server and SQL Azure 8

Same name and namespace in other branches
  1. 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::fieldSetNoDefault()
  2. 3.0.x drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::fieldSetNoDefault()

Override DatabaseSchema::fieldSetNoDefault().

@status complete

Overrides Schema::fieldSetNoDefault

1 call to Schema::fieldSetNoDefault()
Schema::fieldSetDefault in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php
Override DatabaseSchema::fieldSetDefault().

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php, line 1404
Definition of Drupal\Driver\Database\sqlsrv\Schema

Class

Schema

Namespace

Drupal\Driver\Database\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');
}