You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.9 KiB
60 lines
1.9 KiB
9 years ago
|
<?php
|
||
|
|
||
|
namespace yiiunit\framework\db\mysql;
|
||
|
|
||
|
use yii\db\Schema;
|
||
|
|
||
|
/**
|
||
|
* @group db
|
||
|
* @group mysql
|
||
|
*/
|
||
8 years ago
|
class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
|
||
9 years ago
|
{
|
||
8 years ago
|
protected $driverName = 'mysql';
|
||
|
|
||
9 years ago
|
/**
|
||
|
* this is not used as a dataprovider for testGetColumnType to speed up the test
|
||
|
* when used as dataprovider every single line will cause a reconnect with the database which is not needed here
|
||
|
*/
|
||
|
public function columnTypes()
|
||
|
{
|
||
9 years ago
|
return array_merge(parent::columnTypes(), [
|
||
9 years ago
|
[
|
||
9 years ago
|
Schema::TYPE_PK . ' AFTER `col_before`',
|
||
9 years ago
|
$this->primaryKey()->after('col_before'),
|
||
9 years ago
|
'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY AFTER `col_before`'
|
||
9 years ago
|
],
|
||
|
[
|
||
|
Schema::TYPE_PK . ' FIRST',
|
||
|
$this->primaryKey()->first(),
|
||
|
'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST'
|
||
|
],
|
||
|
[
|
||
|
Schema::TYPE_PK . ' FIRST',
|
||
|
$this->primaryKey()->first()->after('col_before'),
|
||
|
'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST'
|
||
|
],
|
||
|
[
|
||
9 years ago
|
Schema::TYPE_PK . '(8) AFTER `col_before`',
|
||
9 years ago
|
$this->primaryKey(8)->after('col_before'),
|
||
9 years ago
|
'int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY AFTER `col_before`'
|
||
9 years ago
|
],
|
||
|
[
|
||
|
Schema::TYPE_PK . '(8) FIRST',
|
||
|
$this->primaryKey(8)->first(),
|
||
|
'int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST'
|
||
|
],
|
||
|
[
|
||
|
Schema::TYPE_PK . '(8) FIRST',
|
||
|
$this->primaryKey(8)->first()->after('col_before'),
|
||
|
'int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST'
|
||
|
],
|
||
9 years ago
|
[
|
||
|
Schema::TYPE_PK . " COMMENT 'test' AFTER `col_before`",
|
||
|
$this->primaryKey()->comment('test')->after('col_before'),
|
||
|
"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'test' AFTER `col_before`"
|
||
|
],
|
||
9 years ago
|
]);
|
||
9 years ago
|
}
|
||
|
}
|