concrete/src/Updater/Migrations/AbstractMigration.php
protected function nullifyInvalidForeignKey($table, $field, $linkedTable, $linkedField)
    {
        $platform = $this->connection->getDatabasePlatform();
        $sqlTable = $platform->quoteSingleIdentifier($table);
        $sqlField = $platform->quoteSingleIdentifier($field);
        $sqlLinkedTable = $platform->quoteSingleIdentifier($linkedTable);
        $sqlLinkedField = $platform->quoteSingleIdentifier($linkedField);
        $this->connection->executeQuery("
            update {$sqlTable}
            left join {$sqlLinkedTable} on {$sqlTable}.{$sqlField} = {$sqlLinkedTable}.{$sqlLinkedField}
            set {$sqlTable}.{$sqlField} = null
            where {$sqlLinkedTable}.{$sqlLinkedField} is null
        ");
    }
protected function nullifyInvalidForeignKey($table, $field, $linkedTable, $linkedField)
    {
        $platform = $this->connection->getDatabasePlatform();
        $sqlTable = $platform->quoteSingleIdentifier($table);
        $sqlField = $platform->quoteSingleIdentifier($field);
        $sqlLinkedTable = $platform->quoteSingleIdentifier($linkedTable);
        $sqlLinkedField = $platform->quoteSingleIdentifier($linkedField);
        $this->connection->executeQuery("
            update {$sqlTable}
            left join {$sqlLinkedTable} on {$sqlTable}.{$sqlField} = {$sqlLinkedTable}.{$sqlLinkedField}
            set {$sqlTable}.{$sqlField} = null
            where {$sqlLinkedTable}.{$sqlLinkedField} is null
        ");
    }
protected function nullifyInvalidForeignKey ( $ table , $ field , $ linkedTable , $ linkedField ) { $ platform = $ this -> connection -> getDatabasePlatform ( ) ; $ sqlTable = $ platform -> quoteSingleIdentifier ( $ table ) ; $ sqlField = $ platform -> quoteSingleIdentifier ( $ field ) ; $ sqlLinkedTable = $ platform -> quoteSingleIdentifier ( $ linkedTable ) ; $ sqlLinkedField = $ platform -> quoteSingleIdentifier ( $ linkedField ) ; $ this -> connection -> executeQuery ( "
            update {$sqlTable}
            left join {$sqlLinkedTable} on {$sqlTable}.{$sqlField} = {$sqlLinkedTable}.{$sqlLinkedField}
            set {$sqlTable}.{$sqlField} = null
            where {$sqlLinkedTable}.{$sqlLinkedField} is null
        " ) ; }
Set to NULL the fields in a table that reference not existing values of another table.

@param string $table The table containing the problematic field
@param string $field The problematic field
@param string $linkedTable The referenced table
@param string $linkedField The referenced field
Set to NULL the fields in a table that reference not existing values of another table .