Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Schema.php

function Schema::indexExists

Same name in this branch
  1. 11.1.x core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::indexExists()
  2. 11.1.x core/modules/pgsql/src/Driver/Database/pgsql/Schema.php \Drupal\pgsql\Driver\Database\pgsql\Schema::indexExists()
  3. 11.1.x core/modules/mysql/src/Driver/Database/mysql/Schema.php \Drupal\mysql\Driver\Database\mysql\Schema::indexExists()

Overrides Schema::indexExists

4 calls to Schema::indexExists()
Schema::addIndex in core/modules/sqlite/src/Driver/Database/sqlite/Schema.php
Add an index.
Schema::addUniqueKey in core/modules/sqlite/src/Driver/Database/sqlite/Schema.php
Add a unique key.
Schema::dropIndex in core/modules/sqlite/src/Driver/Database/sqlite/Schema.php
Drop an index.
Schema::dropUniqueKey in core/modules/sqlite/src/Driver/Database/sqlite/Schema.php
Drop a unique key.

File

core/modules/sqlite/src/Driver/Database/sqlite/Schema.php, line 693

Class

Schema
SQLite implementation of \Drupal\Core\Database\Schema.

Namespace

Drupal\sqlite\Driver\Database\sqlite

Code

public function indexExists($table, $name) {
    $info = $this->getPrefixInfo($table);
    return $this->connection
        ->query('PRAGMA [' . $info['schema'] . '].index_info([' . $info['table'] . '_' . $name . '])')
        ->fetchField() != '';
}
RSS feed
Powered by Drupal