You are here

public function Schema::fieldSetNoDefault in Drupal driver for SQL Server and SQL Azure 3.0.x

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. 8 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::fieldSetNoDefault()
1 call to Schema::fieldSetNoDefault()
Schema::fieldSetDefault in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php, line 387

Class

Schema

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function fieldSetNoDefault($table, $field) {
  @trigger_error('fieldSetNoDefault() is deprecated in drupal:8.7.0 and will be removed before drupal:9.0.0. Instead, call ::changeField() passing a full field specification. See https://www.drupal.org/node/2999035', E_USER_DEPRECATED);
  if (!$this
    ->fieldExists($table, $field)) {
    throw new SchemaObjectDoesNotExistException(t("Cannot remove default value of field %table.%field: field doesn't exist.", [
      '%table' => $table,
      '%field' => $field,
    ]));
  }
  $prefixInfo = $this
    ->getPrefixInfo($table, TRUE);
  $constraint_name = $prefixInfo['table'] . '_' . $field . '_df';
  $this
    ->dropConstraint($table, $constraint_name, FALSE);
}