cakephp / phinx

PHP Database Migrations for Everyone
https://phinx.org
MIT License
4.45k stars 895 forks source link

Fix escaping database name for SqlServerAdapter::dropDatabase #2287

Closed MasterOdin closed 2 months ago

MasterOdin commented 2 months ago

PR fixes a bug introduced in #2286 that broke dropping databases in sqlserver. I've fixed the syntax so that it actually works for database names that need escaping, discovering as well that the escaping of column names was also broken. Per https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms176027(v=sql.105)?redirectedfrom=MSDN, to escape an identifier that has brackets, need to double up the brackets, not use \.