public function SqlServerSchemaTest::testPrimaryKeyAlter in Drupal driver for SQL Server and SQL Azure 8
Test altering a primary key.
File
- src/
Tests/ SqlServerSchemaTest.php, line 74 - Definition of Drupal\sqlsrv\Tests\SqlServerSchemaTest.
Class
- SqlServerSchemaTest
- Schema tests for SQL Server database driver.
Namespace
Drupal\sqlsrv\TestsCode
public function testPrimaryKeyAlter() {
$table_spec = array(
'fields' => array(
'id' => array(
'type' => 'int',
'not null' => TRUE,
),
),
'primary key' => array(
'id',
),
);
db_create_table('test_table', $table_spec);
// Add a default value.
db_change_field('test_table', 'id', 'id', array(
'type' => 'int',
'not null' => TRUE,
'default' => 1,
));
}