Improved migrations
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
"slim/twig-view": "^3.4",
|
||||
"catfan/medoo": "2.*",
|
||||
"vlucas/phpdotenv": "^5.6",
|
||||
"ezyang/htmlpurifier": "^4.19"
|
||||
"ezyang/htmlpurifier": "^4.19",
|
||||
"slim/csrf": "^1.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@@ -6,9 +6,16 @@ namespace App\Database;
|
||||
|
||||
use Medoo\Medoo;
|
||||
|
||||
final class Migration
|
||||
final class Migrator
|
||||
{
|
||||
public static function run(Medoo $db): void
|
||||
{
|
||||
self::createPostTable($db);
|
||||
// self::createCommentsTable($db);
|
||||
// self::createUsersTable($db);
|
||||
}
|
||||
|
||||
private static function createPostTable(Medoo $db): void
|
||||
{
|
||||
$db->pdo->exec("
|
||||
CREATE TABLE IF NOT EXISTS post (
|
||||
Reference in New Issue
Block a user