mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-04 18:42:40 +00:00
Correctly generate bigint primary keys in sqlite.
generate bigint primary keys correctly. Autoincrement cannot be set as it only works with INTEGER columns[1]. I decided to use some string manipulations as the entire SQL generation bits are a bit janky and I've already re-written them for 3.0. [1] https://www.sqlite.org/autoinc.html Closes #GH-1552
This commit is contained in:
parent
1777c4fdd2
commit
c1ae41da51
2 changed files with 22 additions and 2 deletions
|
@ -264,6 +264,17 @@ class SqliteTest extends CakeTestCase {
|
|||
$result = $this->Dbo->buildColumn($data);
|
||||
$expected = '"huge" bigint(20) NOT NULL';
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$data = array(
|
||||
'name' => 'id',
|
||||
'type' => 'biginteger',
|
||||
'length' => 20,
|
||||
'null' => false,
|
||||
'key' => 'primary',
|
||||
);
|
||||
$result = $this->Dbo->buildColumn($data);
|
||||
$expected = '"id" bigint(20) NOT NULL PRIMARY KEY';
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue