current init
This commit is contained in:
33
backend/migrations/Version20260324141105.php
Normal file
33
backend/migrations/Version20260324141105.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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 Version20260324141105 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 task_completion (id INT AUTO_INCREMENT NOT NULL, date DATE NOT NULL, task_id INT NOT NULL, INDEX IDX_24C57CD18DB60186 (task_id), UNIQUE INDEX UNIQ_24C57CD18DB60186AA9E377A (task_id, date), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
|
||||
$this->addSql('ALTER TABLE task_completion ADD CONSTRAINT FK_24C57CD18DB60186 FOREIGN KEY (task_id) REFERENCES task (id) ON DELETE CASCADE');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE task_completion DROP FOREIGN KEY FK_24C57CD18DB60186');
|
||||
$this->addSql('DROP TABLE task_completion');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user