migrations/Version20230912125052.php line 1
<?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 Version20230912125052 extends AbstractMigration
{
public function getDescription(): string
{
return 'add wiki_course_progress';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE wiki_course_progress (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, course_id INT DEFAULT NULL, progress INT NOT NULL, INDEX IDX_86063A83A76ED395 (user_id), INDEX IDX_86063A83591CC992 (course_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE wiki_course_progress ADD CONSTRAINT FK_86063A83A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE wiki_course_progress ADD CONSTRAINT FK_86063A83591CC992 FOREIGN KEY (course_id) REFERENCES wiki_course (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE wiki_course_progress DROP FOREIGN KEY FK_86063A83A76ED395');
$this->addSql('ALTER TABLE wiki_course_progress DROP FOREIGN KEY FK_86063A83591CC992');
$this->addSql('DROP TABLE wiki_course_progress');
}
}