34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
*/
|
|
final class Version20260604194453 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return '';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
// this up() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('CREATE TABLE rating (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, score SMALLINT DEFAULT NULL, subject_id INT NOT NULL, PRIMARY KEY (id))');
|
|
$this->addSql('CREATE INDEX IDX_D889262223EDC87 ON rating (subject_id)');
|
|
$this->addSql('ALTER TABLE rating ADD CONSTRAINT FK_D889262223EDC87 FOREIGN KEY (subject_id) REFERENCES subject (id) NOT DEFERRABLE');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('ALTER TABLE rating DROP CONSTRAINT FK_D889262223EDC87');
|
|
$this->addSql('DROP TABLE rating');
|
|
}
|
|
}
|