Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove leftovers of handling foreign keys on non-InnoDB engines for MySQL #5664

Merged
merged 1 commit into from
Sep 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/Platforms/AbstractMySQLPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
use function is_numeric;
use function sprintf;
use function str_replace;
use function strtoupper;
use function trim;

/**
* Provides the base implementation for the lowest versions of supported MySQL-like database platforms.
Expand Down Expand Up @@ -253,7 +251,6 @@ protected function _getCreateTableSQL(string $name, array $columns, array $optio

$sql = [implode(' ', $sql)];

// Propagate foreign key constraints only for InnoDB.
if (isset($options['foreignKeys'])) {
foreach ($options['foreignKeys'] as $definition) {
$sql[] = $this->getCreateForeignKeySQL($definition, $name);
Expand Down Expand Up @@ -440,19 +437,6 @@ protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff): array
}
}

$engine = 'INNODB';

if ($diff->fromTable instanceof Table && $diff->fromTable->hasOption('engine')) {
$engine = strtoupper(trim($diff->fromTable->getOption('engine')));
}

// Suppress foreign key constraint propagation on non-supporting engines.
if ($engine !== 'INNODB') {
$diff->addedForeignKeys = [];
$diff->changedForeignKeys = [];
$diff->removedForeignKeys = [];
}

return array_merge(
$sql,
$this->getPreAlterTableAlterIndexForeignKeySQL($diff),
Expand Down