update install2
This commit is contained in:
parent
52be768699
commit
595c9b31cf
@ -28,6 +28,8 @@ function runSqlFile($pdo, $filePath) {
|
|||||||
strpos($msg, 'Duplicate key name') !== false ||
|
strpos($msg, 'Duplicate key name') !== false ||
|
||||||
strpos($msg, 'Duplicate entry') !== false ||
|
strpos($msg, 'Duplicate entry') !== false ||
|
||||||
strpos($msg, "Can't DROP") !== false ||
|
strpos($msg, "Can't DROP") !== false ||
|
||||||
|
strpos($msg, "Cannot drop index") !== false ||
|
||||||
|
strpos($msg, "needed in a foreign key constraint") !== false ||
|
||||||
strpos($msg, 'check that column/key exists') !== false ||
|
strpos($msg, 'check that column/key exists') !== false ||
|
||||||
strpos($msg, 'Unknown table') !== false
|
strpos($msg, 'Unknown table') !== false
|
||||||
) {
|
) {
|
||||||
@ -111,7 +113,9 @@ function has_permission(\$action, \$page = null, \$user_id = null) {
|
|||||||
file_put_contents(__DIR__ . '/db/config.php', $configContent);
|
file_put_contents(__DIR__ . '/db/config.php', $configContent);
|
||||||
|
|
||||||
// Run initial schema
|
// Run initial schema
|
||||||
$migrations = glob(__DIR__ . '/db/migrations/*.sql'); sort($migrations); foreach ($migrations as $migration) { runSqlFile($pdo, $migration); }
|
$pdo->exec("SET FOREIGN_KEY_CHECKS = 0;");
|
||||||
|
$migrations = glob(__DIR__ . "/db/migrations/*.sql"); sort($migrations); foreach ($migrations as $migration) { runSqlFile($pdo, $migration); }
|
||||||
|
$pdo->exec("SET FOREIGN_KEY_CHECKS = 1;");
|
||||||
|
|
||||||
$_SESSION['db_configured'] = true;
|
$_SESSION['db_configured'] = true;
|
||||||
header("Location: install.php?step=3");
|
header("Location: install.php?step=3");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user