mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
[ticket/17528] Add test for adding autoincrement column
PHPBB-17528
This commit is contained in:
@@ -25,6 +25,7 @@ require_once __DIR__ . '/migration/fail.php';
|
||||
require_once __DIR__ . '/migration/installed.php';
|
||||
require_once __DIR__ . '/migration/schema.php';
|
||||
require_once __DIR__ . '/migration/schema_index.php';
|
||||
require_once __DIR__ . '/migration/schema_add_autoincrement.php';
|
||||
|
||||
class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
||||
{
|
||||
@@ -502,4 +503,24 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function test_add_autoincrement_column()
|
||||
{
|
||||
$this->migrator->set_migrations(['schema_add_autoincrement']);
|
||||
|
||||
while (!$this->migrator->finished())
|
||||
{
|
||||
$this->migrator->update();
|
||||
}
|
||||
|
||||
$this->assertTrue($this->db_tools->sql_table_exists('phpbb_noid'));
|
||||
$this->assertTrue($this->db_tools->sql_column_exists('phpbb_noid', 'id'));
|
||||
|
||||
while ($this->migrator->migration_state('schema_add_autoincrement'))
|
||||
{
|
||||
$this->migrator->revert('schema_add_autoincrement');
|
||||
}
|
||||
|
||||
$this->assertFalse($this->db_tools->sql_table_exists('phpbb_noid'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user