WIP: Implement feedback functionality

This commit is contained in:
Björn Fromme
2023-11-03 09:20:48 +01:00
parent d024e11f8f
commit d016ee043a
12 changed files with 123 additions and 73 deletions
+43
View File
@@ -0,0 +1,43 @@
<?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 Version20231103081749 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('ALTER TABLE disposition ADD feedback_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE disposition ADD CONSTRAINT FK_4C58BF60D249A887 FOREIGN KEY (feedback_id) REFERENCES feedback (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_4C58BF60D249A887 ON disposition (feedback_id)');
$this->addSql('ALTER TABLE feedback DROP FOREIGN KEY FK_D2294458D19302F8');
$this->addSql('DROP INDEX IDX_D2294458D19302F8 ON feedback');
$this->addSql('ALTER TABLE feedback DROP assignment_id');
$this->addSql('ALTER TABLE feedback_set ADD created_by VARCHAR(255) DEFAULT NULL, ADD updated_by VARCHAR(255) DEFAULT NULL, CHANGE items ratings JSON NOT NULL COMMENT \'(DC2Type:json)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE disposition DROP FOREIGN KEY FK_4C58BF60D249A887');
$this->addSql('DROP INDEX UNIQ_4C58BF60D249A887 ON disposition');
$this->addSql('ALTER TABLE disposition DROP feedback_id');
$this->addSql('ALTER TABLE feedback ADD assignment_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE feedback ADD CONSTRAINT FK_D2294458D19302F8 FOREIGN KEY (assignment_id) REFERENCES assignment (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_D2294458D19302F8 ON feedback (assignment_id)');
$this->addSql('ALTER TABLE feedback_set DROP created_by, DROP updated_by, CHANGE ratings items JSON NOT NULL COMMENT \'(DC2Type:json)\'');
}
}