Migration1679581138RemoveAssociationFields example

public function testUpdateDestructiveRemovesColumn(): void
    {
        $existed = $this->columnExists();

        $tableData = null;
        if ($existed) {
            $tableData = $this->fetchData();
        } else {
            $this->addColumn();
        }

        $migration = new Migration1679581138RemoveAssociationFields();
        $migration->updateDestructive($this->connection);
        $migration->updateDestructive($this->connection);

        static::assertFalse($this->columnExists());

        if ($existed) {
            $this->addColumn();
            $this->restoreAssociations($tableData);
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.