blessing-skin-server/app/Services/Database/Migration.php
2016-08-28 18:33:47 +08:00

29 lines
642 B
PHP

<?php
namespace App\Services\Database;
class Migration
{
/**
* Create tables, prefix will be added automatically
*
* @return void
*/
public static function creatTables()
{
require BASE_DIR."/setup/tables.php";
}
public static function __callStatic($method, $args)
{
if (strpos($method, 'import') !== false) {
$filename = BASE_DIR."/setup/migrations/".snake_case($method).".php";
if (file_exists($filename)) {
return require $filename;
}
}
throw new \InvalidArgumentException('Non-existent migration');
}
}