diff --git a/tests/framework/db/QueryBuilderTest.php b/tests/framework/db/QueryBuilderTest.php index b2a3239c66..d39c4adea0 100644 --- a/tests/framework/db/QueryBuilderTest.php +++ b/tests/framework/db/QueryBuilderTest.php @@ -103,6 +103,46 @@ class QueryBuilderTest extends DatabaseTestCase $this->primaryKey(8)->check('value > 5'), 'int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY CHECK (value > 5)' ], + [ + Schema::TYPE_PK . ' FIRST', + $this->primaryKey()->first(), + 'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST' + ], + [ + Schema::TYPE_PK . '(8) FIRST', + $this->primaryKey(8)->first(), + 'int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST' + ], + [ + Schema::TYPE_PK . ' AFTER (\'col_before\')', + $this->primaryKey()->after('col_before'), + 'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY AFTER (\'col_before\')' + ], + [ + Schema::TYPE_PK . ' AFTER (\'col_before\')', + $this->primaryKey(8)->after('col_before'), + 'int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY AFTER (\'col_before\')' + ], + [ + Schema::TYPE_PK . ' FIRST', + $this->primaryKey()->first()->after('col_before'), + 'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY AFTER (\'col_before\')' + ], + [ + Schema::TYPE_PK . '(8) FIRST', + $this->primaryKey(8)->first()->after('col_before'), + 'int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY AFTER (\'col_before\')' + ], + [ + Schema::TYPE_UNSIGNEDPK, + $this->unsignedPrimaryKey(), + 'int(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' + ], + [ + Schema::TYPE_UNSIGNEDPK . '(20)', + $this->primaryKey(20), + 'int(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' + ], [ Schema::TYPE_CHAR, $this->char(), diff --git a/tests/framework/db/sqlite/SqliteQueryBuilderTest.php b/tests/framework/db/sqlite/SqliteQueryBuilderTest.php index 6614938e37..2ea90191c9 100644 --- a/tests/framework/db/sqlite/SqliteQueryBuilderTest.php +++ b/tests/framework/db/sqlite/SqliteQueryBuilderTest.php @@ -37,6 +37,16 @@ class SqliteQueryBuilderTest extends QueryBuilderTest $this->primaryKey(8)->check('value > 5'), 'integer PRIMARY KEY AUTOINCREMENT NOT NULL CHECK (value > 5)' ], + [ + Schema::TYPE_PK, + $this->primaryKey()->first()->after('col_before'), + 'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY' + ], + [ + Schema::TYPE_PK . '(8)', + $this->primaryKey(8)->first()->after('col_before'), + 'int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY' + ], [ Schema::TYPE_CHAR, $this->char(),