chore: complete update
This commit is contained in:
38
src/Domain/Contact/Migrations/CreateContactTable.php
Normal file
38
src/Domain/Contact/Migrations/CreateContactTable.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Contact\Migrations;
|
||||
|
||||
use App\Framework\Database\ConnectionInterface;
|
||||
use App\Framework\Database\Migration\Migration;
|
||||
|
||||
final readonly class CreateContactTable implements Migration
|
||||
{
|
||||
|
||||
public function up(ConnectionInterface $connection): void
|
||||
{
|
||||
$sql = <<<SQL
|
||||
CREATE TABLE IF NOT EXISTS contacts (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
email VARCHAR(255) NOT NULL,
|
||||
message TEXT NOT NULL
|
||||
)
|
||||
SQL;
|
||||
$connection->execute($sql);
|
||||
}
|
||||
|
||||
public function down(ConnectionInterface $connection): void
|
||||
{
|
||||
$connection->execute('DROP TABLE IF EXISTS contacts');
|
||||
}
|
||||
|
||||
public function getVersion(): string
|
||||
{
|
||||
return '005';
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Create contact table';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user