mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 04:18:55 +00:00
Compare commits
5 commits
2c3e0683a8
...
be3438d573
Author | SHA1 | Date | |
---|---|---|---|
|
be3438d573 | ||
|
e37312c397 | ||
|
4bdf5ab6d2 | ||
|
993e637af9 | ||
|
83c6ffce64 |
3 changed files with 11 additions and 12 deletions
|
@ -514,7 +514,7 @@ class doctrine implements tools_interface
|
|||
catch (Exception $e)
|
||||
{
|
||||
// @todo: check if it makes sense to properly handle the exception
|
||||
return false;
|
||||
return [$e->getMessage()];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,15 +26,15 @@ class phpbb_dbal_migration_schema extends \phpbb\db\migration\migration
|
|||
'COLUMNS' => [
|
||||
'module_id' => ['UINT:3', NULL, 'auto_increment'],
|
||||
'user_id' => ['ULINT', 0],
|
||||
'endpoint' => ['TEXT', ''],
|
||||
'endpoint' => ['VCHAR:220', ''],
|
||||
'expiration_time' => ['TIMESTAMP', 0],
|
||||
'p256dh' => ['VCHAR', ''],
|
||||
'p256dh' => ['VCHAR:200', ''],
|
||||
'auth' => ['VCHAR:100', ''],
|
||||
],
|
||||
'PRIMARY_KEY' => 'module_id',
|
||||
'KEYS' => [
|
||||
'i_simple' => ['INDEX', ['user_id', 'endpoint:191']],
|
||||
'i_uniq' => ['UNIQUE', ['expiration_time', 'p256dh(100)']],
|
||||
// 'i_simple' => ['INDEX', ['user_id', 'endpoint:191']],
|
||||
// 'i_uniq' => ['UNIQUE', ['expiration_time', 'p256dh(100)']],
|
||||
'i_auth' => ['INDEX', 'auth'],
|
||||
],
|
||||
],
|
||||
|
|
|
@ -409,8 +409,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
|||
$this->assertTrue($this->db_tools->sql_table_exists('phpbb_foobar'));
|
||||
|
||||
$index_data_row = $this->db_tools->sql_get_table_index_data('phpbb_foobar');
|
||||
$is_mysql = $this->db->get_sql_layer() === 'mysqli'; // Index length only applies to MySQL indexes
|
||||
$is_mssql = in_array($this->db->get_sql_layer(), ['mssqlnative', 'mssql_odbc']); // MSSQL primary index key has 'clustered' flag
|
||||
$mysql = $this->db->get_sql_layer() === 'mysqli'; // Index length only applies to MySQL indexes
|
||||
foreach ($index_data_row as $index_name => $index_data)
|
||||
{
|
||||
switch ($index_name)
|
||||
|
@ -423,9 +422,9 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
|||
$this->assertTrue($index_data['is_simple']);
|
||||
$this->assertEquals(2, count($index_data['options']['lengths']));
|
||||
$this->assertEmpty($index_data['options']['lengths'][0]);
|
||||
$this->assertEquals($is_mysql ? 191 : null, $index_data['options']['lengths'][1]);
|
||||
$this->assertEquals($mysql ? 191 : null, $index_data['options']['lengths'][1]);
|
||||
break;
|
||||
case 'i_uniq':
|
||||
/* case 'i_uniq':
|
||||
$this->assertEquals(['expiration_time', 'p256dh'], $index_data['columns']);
|
||||
$this->assertEmpty($index_data['flags']);
|
||||
$this->assertFalse($index_data['is_primary']);
|
||||
|
@ -433,8 +432,8 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
|||
$this->assertFalse($index_data['is_simple']);
|
||||
$this->assertEquals(2, count($index_data['options']['lengths']));
|
||||
$this->assertEmpty($index_data['options']['lengths'][0]);
|
||||
$this->assertEquals($is_mysql ? 100 : null, $index_data['options']['lengths'][1]);
|
||||
break;
|
||||
$this->assertEquals($mysql ? 100 : null, $index_data['options']['lengths'][1]);
|
||||
break;*/
|
||||
case 'i_auth':
|
||||
$this->assertEquals(['auth'], $index_data['columns']);
|
||||
$this->assertEmpty($index_data['flags']);
|
||||
|
@ -446,7 +445,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
|||
break;
|
||||
default: // Primary key
|
||||
$this->assertEquals(['module_id'], $index_data['columns']);
|
||||
$this->assertEquals($is_mssql ? ['clustered'] : [], $index_data['flags']);
|
||||
$this->assertEmpty($index_data['flags']);
|
||||
$this->assertTrue($index_data['is_primary']);
|
||||
$this->assertTrue($index_data['is_unique']);
|
||||
$this->assertFalse($index_data['is_simple']);
|
||||
|
|
Loading…
Add table
Reference in a new issue