mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[feature/migrations] Make depends_on static to call it without dependencies
Move installing migrations to migration/install.php and handle figuring out what migrations have been installed based on phpBB version. PHPBB3-11318
This commit is contained in:
@@ -147,21 +147,13 @@ header('Content-type: text/html; charset=UTF-8');
|
||||
|
||||
// End startup code
|
||||
|
||||
// Make sure migrations have been installed. If not, install migrations and guess what migrations have been installed
|
||||
$db_tools = $phpbb_container->get('dbal.tools');
|
||||
if (!$db_tools->sql_table_exists(MIGRATIONS_TABLE))
|
||||
{
|
||||
$db_tools->sql_create_table(MIGRATIONS_TABLE, array(
|
||||
'COLUMNS' => array(
|
||||
'migration_name' => array('VCHAR', ''),
|
||||
'migration_depends_on' => array('TEXT', ''),
|
||||
'migration_schema_done' => array('BOOL', 0),
|
||||
'migration_data_done' => array('BOOL', 0),
|
||||
'migration_data_state' => array('TEXT', ''),
|
||||
'migration_start_time' => array('TIMESTAMP', 0),
|
||||
'migration_end_time' => array('TIMESTAMP', 0),
|
||||
),
|
||||
'PRIMARY_KEY' => 'migration_name',
|
||||
));
|
||||
$migrations_installer = new phpbb_db_migration_install();
|
||||
$migrations_installer->install($db, $db_tools, $table_prefix, $config['version']);
|
||||
unset($migrations_installer);
|
||||
}
|
||||
|
||||
$migrator = $phpbb_container->get('migrator');
|
||||
|
Reference in New Issue
Block a user