migrations/2023/02/Version20230219211826.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;final class Version20230219211826 extends AbstractMigration{public function up(Schema $schema): void{$this->addSql('ALTER TABLE profit_calculation_row DROP FOREIGN KEY FK_E32377A3ECFF285C');$this->addSql('DROP TABLE profit_calculation');$this->addSql('DROP TABLE profit_calculation_row');}public function down(Schema $schema): void{$this->addSql('CREATE TABLE profit_calculation (id BINARY(16) NOT NULL COMMENT \'(DC2Type:profit_calculation_id)\', contact_id BINARY(16) NOT NULL COMMENT \'(DC2Type:contact_id)\', associated_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:contact_id)\', title VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, year VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, active INT DEFAULT 1 NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_429D0587E7A1254A (contact_id), INDEX IDX_429D0587C16040B (associated_contact_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');$this->addSql('CREATE TABLE profit_calculation_row (id BINARY(16) NOT NULL COMMENT \'(DC2Type:profit_calculation_item_id)\', table_id BINARY(16) NOT NULL COMMENT \'(DC2Type:profit_calculation_id)\', name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, amount NUMERIC(10, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL, row_type INT NOT NULL, date_time DATETIME NOT NULL, INDEX IDX_E32377A3ECFF285C (table_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');$this->addSql('ALTER TABLE profit_calculation ADD CONSTRAINT FK_429D0587C16040B FOREIGN KEY (associated_contact_id) REFERENCES contact (id)');$this->addSql('ALTER TABLE profit_calculation ADD CONSTRAINT FK_429D0587E7A1254A FOREIGN KEY (contact_id) REFERENCES contact (id)');$this->addSql('ALTER TABLE profit_calculation_row ADD CONSTRAINT FK_E32377A3ECFF285C FOREIGN KEY (table_id) REFERENCES profit_calculation (id)');}}