Added table create routine

This commit is contained in:
Kevin Frantz
2018-07-14 20:09:56 +02:00
parent a61f5550b7
commit f51177f703
4 changed files with 27 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
<?php
use core\Core;
require __DIR__. '/../vendor/autoload.php';
/**
* Maintainance script - Not written nice ;)
**/
function loadAndExec(string $file){
$core = new Core();
$pdo = $core->getDatabase();
echo "Create database $file...\n";
$pdo->exec(file_get_contents(__DIR__.'/database/'.$file.'.sql'));
}
echo "Create databases...\n";
foreach(['order_product','order','product','user'] as $file){
loadAndExec($file);
}
?>