1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/12870] Create the migrations table with a method in the migrator

PHPBB3-12870
This commit is contained in:
Tristan Darricau
2014-07-27 11:08:13 +02:00
parent e4a829071e
commit a8e81b6e9f
5 changed files with 29 additions and 47 deletions

View File

@@ -767,4 +767,24 @@ class migrator
return $this->migrations;
}
public function create_migrations_table()
{
// Make sure migrations have been installed.
if (!$this->db_tools->sql_table_exists($this->table_prefix . 'migrations'))
{
$this->db_tools->sql_create_table($this->table_prefix . 'migrations', 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',
));
}
}
}