chore: complete update
This commit is contained in:
36
src/Domain/User/Migrations/CreateUsersTable.php
Normal file
36
src/Domain/User/Migrations/CreateUsersTable.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\User\Migrations;
|
||||
|
||||
use App\Framework\Database\ConnectionInterface;
|
||||
use App\Framework\Database\Migration\Migration;
|
||||
|
||||
final readonly class CreateUsersTable implements Migration
|
||||
{
|
||||
|
||||
public function up(ConnectionInterface $connection): void
|
||||
{
|
||||
$connection->query("CREATE TABLE IF NOT EXISTS users (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
ulid BINARY(16) NOT NULL UNIQUE,
|
||||
name VARCHAR(255) NOT NULL
|
||||
)"
|
||||
);
|
||||
}
|
||||
|
||||
public function down(ConnectionInterface $connection): void
|
||||
{
|
||||
$connection->query("DROP TABLE users");
|
||||
}
|
||||
|
||||
public function getVersion(): string
|
||||
{
|
||||
return "001";
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return "Create Users Table";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user