1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

[feature/migrations] Function effectively_installed() in migrations

Allows you to check if the migration is effectively installed
(entirely optionall)

This function is intended to help moving to migrations from a
previous database updater, where some migrations may have been
installed already even though they are not yet listed in the
migrations table.

PHPBB3-9737
This commit is contained in:
Nathan Guse
2013-01-13 12:39:08 -06:00
parent 93f9ebbb25
commit 26c16559c3
4 changed files with 83 additions and 3 deletions

View File

@@ -271,10 +271,24 @@ class phpbb_db_migrator
'class' => $migration,
);
if (!isset($this->migration_state[$name]))
if ($migration->effectively_installed())
{
$state['migration_start_time'] = time();
$this->insert_migration($name, $state);
$state = array(
'migration_depends_on' => $migration->depends_on(),
'migration_schema_done' => true,
'migration_data_done' => true,
'migration_data_state' => '',
'migration_start_time' => 0,
'migration_end_time' => 0,
);
}
else
{
if (!isset($this->migration_state[$name]))
{
$state['migration_start_time'] = time();
$this->insert_migration($name, $state);
}
}
if (!$state['migration_schema_done'])