-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
DBAL-694: Extend AbstractSchemaManager::dropTable() signature #1916
Comments
Comment created by @deeky666: [~velosipedist] can you please give some information of what you want to achieve with this addition? There are several problems I see here:
Possible solutions depending on what you want to do:
You see there are lots of possibilities already and I am not quite sure if we should bloat the schema manager API with more alias methods (dropIfExists, createIfNotExists) that actually don't do anything special. |
Comment created by velosipedist: Thanks, while i used to wait for answer, i took solution #3 for iExists functionality purposes (test suite setUp & tearDown clean-ups). And also thanks for DBALException::ERROR_UNKNOWN_TABLE hint — it solves problem finally, without API changes. |
Comment created by velosipedist: Found some workarounds, which worth to be documented |
Issue was closed with resolution "Won't Fix" |
Comment created by @deeky666: [~velosipedist] The DBALException error constants are pretty new and need indeed documentation. I will provide that during the next days. Also these exception error codes are converted into an own exception class on the fly (see: #458). Not all DBALException::ERROR_* constants will get converted at this time though. Some are still missing but will be added soon. Then you are able to do something like this: // Schema manager.
try {
$sm->dropTable('mytable');
} catch (\Doctrine\DBAL\Excpetion\TableNotFoundException $e) { // exception class not yet available
// do something
} Besides that do you think there is still anything to do here? Or are those solutions acceptable for you? |
Comment created by velosipedist: Solution with tableExists() check is acceptable in my scenario, although it adds some db overhead in my tests. Issue does not have sense now. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Jira issue originally created by user velosipedist:
For now, dropTable($tableName) doesn't take into account useful IF EXISTS flag.
I can submit PR with myself if this proposal will be accepted.
The text was updated successfully, but these errors were encountered: