<?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 Version20240805105503 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 bo_plan DROP FOREIGN KEY FK_3EBAE34614463F54');
$this->addSql('ALTER TABLE bo_plan DROP FOREIGN KEY FK_3EBAE346E3EB8173');
$this->addSql('ALTER TABLE bo_plan_subject_category DROP FOREIGN KEY FK_A49417288B9A65FF');
$this->addSql('ALTER TABLE bo_plan_week_changes DROP FOREIGN KEY FK_6110AB411A8F78AC');
$this->addSql('ALTER TABLE bo_plan_week_changes DROP FOREIGN KEY FK_6110AB415B57C7EF');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5F5C2A31C5');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5F71F7E88B');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5FA563B7E2');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5FCE50426D');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5F5FBBB4F2');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5F8863C3A6');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5FB79F5C75');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5F4CB1CEC1');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5F650F5579');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5F94759198');
$this->addSql('ALTER TABLE bo_plan_week DROP FOREIGN KEY FK_9C0A3A5FB83EE2E8');
$this->addSql('ALTER TABLE bo_plan_subject DROP FOREIGN KEY FK_F77C9E13A2FE0107');
$this->addSql('DROP TABLE bo_plan');
$this->addSql('DROP TABLE bo_plan_reference');
$this->addSql('DROP TABLE bo_plan_state');
$this->addSql('DROP TABLE bo_plan_subject_category');
$this->addSql('DROP TABLE bo_plan_week_state');
$this->addSql('DROP TABLE bo_plan_subject_custom');
$this->addSql('DROP TABLE bo_plan_week_changes');
$this->addSql('DROP TABLE bo_plan_activity_type');
$this->addSql('DROP TABLE bo_plan_week');
$this->addSql('DROP TABLE bo_plan_subject');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE bo_plan (id INT AUTO_INCREMENT NOT NULL, school_class_id INT DEFAULT NULL, boplan_state_id INT DEFAULT NULL, INDEX IDX_3EBAE346E3EB8173 (boplan_state_id), UNIQUE INDEX UNIQ_3EBAE34614463F54 (school_class_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE bo_plan_reference (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(2) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE bo_plan_state (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE bo_plan_subject_category (id INT AUTO_INCREMENT NOT NULL, school_class_grade_id INT DEFAULT NULL, name VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, position SMALLINT NOT NULL, INDEX IDX_A49417288B9A65FF (school_class_grade_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE bo_plan_week_state (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE bo_plan_subject_custom (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE bo_plan_week_changes (id INT AUTO_INCREMENT NOT NULL, week_plan_id INT DEFAULT NULL, teacher_change_id INT DEFAULT NULL, change_date DATETIME DEFAULT NULL, change_fields MEDIUMTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_6110AB411A8F78AC (week_plan_id), INDEX IDX_6110AB415B57C7EF (teacher_change_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE bo_plan_activity_type (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE bo_plan_week (id INT AUTO_INCREMENT NOT NULL, bo_plan_id INT DEFAULT NULL, bo_plan_week_state_id INT DEFAULT NULL, event_id INT DEFAULT NULL, bo_plan_subject_id INT DEFAULT NULL, bo_plan_subject_custom_id INT DEFAULT NULL, school_subject_id INT DEFAULT NULL, bo_plan_activity_type_id INT DEFAULT NULL, teacher_delete_id INT DEFAULT NULL, teacher_create_id INT DEFAULT NULL, teacher_done_id INT DEFAULT NULL, bo_plan_reference_id INT DEFAULT NULL, week INT NOT NULL COMMENT \'Schulwoche\', note MEDIUMTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'Anmerkung\', hours INT NOT NULL COMMENT \'Stundenanzahl\', lecturer MEDIUMTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'Lehrperson\', created_at DATETIME DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, done_at DATETIME DEFAULT NULL, INDEX IDX_9C0A3A5F5C2A31C5 (bo_plan_week_state_id), INDEX IDX_9C0A3A5F94759198 (teacher_create_id), INDEX IDX_9C0A3A5FB79F5C75 (school_subject_id), INDEX IDX_9C0A3A5F71F7E88B (event_id), INDEX IDX_9C0A3A5F650F5579 (teacher_done_id), INDEX IDX_9C0A3A5F5FBBB4F2 (bo_plan_activity_type_id), INDEX IDX_9C0A3A5FCE50426D (bo_plan_subject_id), INDEX IDX_9C0A3A5F4CB1CEC1 (bo_plan_id), INDEX IDX_9C0A3A5FA563B7E2 (bo_plan_reference_id), INDEX IDX_9C0A3A5F8863C3A6 (teacher_delete_id), INDEX IDX_9C0A3A5FB83EE2E8 (bo_plan_subject_custom_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE bo_plan_subject (id INT AUTO_INCREMENT NOT NULL, bo_plan_subject_category_id INT DEFAULT NULL, name VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, position SMALLINT NOT NULL, INDEX IDX_F77C9E13A2FE0107 (bo_plan_subject_category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE bo_plan ADD CONSTRAINT FK_3EBAE34614463F54 FOREIGN KEY (school_class_id) REFERENCES school_class (id)');
$this->addSql('ALTER TABLE bo_plan ADD CONSTRAINT FK_3EBAE346E3EB8173 FOREIGN KEY (boplan_state_id) REFERENCES bo_plan_state (id)');
$this->addSql('ALTER TABLE bo_plan_subject_category ADD CONSTRAINT FK_A49417288B9A65FF FOREIGN KEY (school_class_grade_id) REFERENCES school_class_grade (id)');
$this->addSql('ALTER TABLE bo_plan_week_changes ADD CONSTRAINT FK_6110AB411A8F78AC FOREIGN KEY (week_plan_id) REFERENCES bo_plan_week (id)');
$this->addSql('ALTER TABLE bo_plan_week_changes ADD CONSTRAINT FK_6110AB415B57C7EF FOREIGN KEY (teacher_change_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5F5C2A31C5 FOREIGN KEY (bo_plan_week_state_id) REFERENCES bo_plan_week_state (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5F71F7E88B FOREIGN KEY (event_id) REFERENCES event (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5FA563B7E2 FOREIGN KEY (bo_plan_reference_id) REFERENCES bo_plan_reference (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5FCE50426D FOREIGN KEY (bo_plan_subject_id) REFERENCES bo_plan_subject (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5F5FBBB4F2 FOREIGN KEY (bo_plan_activity_type_id) REFERENCES bo_plan_activity_type (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5F8863C3A6 FOREIGN KEY (teacher_delete_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5FB79F5C75 FOREIGN KEY (school_subject_id) REFERENCES school_subject (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5F4CB1CEC1 FOREIGN KEY (bo_plan_id) REFERENCES bo_plan (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5F650F5579 FOREIGN KEY (teacher_done_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5F94759198 FOREIGN KEY (teacher_create_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE bo_plan_week ADD CONSTRAINT FK_9C0A3A5FB83EE2E8 FOREIGN KEY (bo_plan_subject_custom_id) REFERENCES bo_plan_subject_custom (id)');
$this->addSql('ALTER TABLE bo_plan_subject ADD CONSTRAINT FK_F77C9E13A2FE0107 FOREIGN KEY (bo_plan_subject_category_id) REFERENCES bo_plan_subject_category (id)');
}
}