38 lines
875 B
PHP
38 lines
875 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace MyTube\Migrations\MyTube;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
*/
|
|
final class Version20240229205003 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'video_event';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$sql = "CREATE TABLE video_event (
|
|
id binary(16) NOT NULL,
|
|
video_id binary(16) NOT NULL,
|
|
datetime datetime NOT NULL,
|
|
type varchar(255) NOT NULL,
|
|
PRIMARY KEY (video_id, datetime, type)
|
|
);";
|
|
|
|
$this->addSql($sql);
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql("DROP TABLE video_event;");
|
|
}
|
|
}
|