- Issue created by @Chi
- 🇷🇺Russia Chi
Actually I think the default behavior is wrong.
tableExists()
method should not look for views. First of all it's not comply with its name. Second it causes errors when doing schema alterations as otherSchema
methods relies ontableExists()
.A simple example to demonstrate the problem.
$schema = \Drupal::database()->schema(); if ($schema->tableExists('some_view')) { $schema->dropTable('some_view'); }
The above code returns the following error on MySQL database.
SQLSTATE[42S02]: Base table or view not found: 1965 'd10.some_view' is a view
- 🇳🇿New Zealand quietone
Fixes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.