Commit dc2a03df authored by Steve Müller's avatar Steve Müller

Extend ReservedWordsCommand to respect new SQL Server keyword dictionaries

parent 549b6343
...@@ -30,12 +30,15 @@ use Doctrine\DBAL\Platforms\Keywords\ReservedKeywordsValidator; ...@@ -30,12 +30,15 @@ use Doctrine\DBAL\Platforms\Keywords\ReservedKeywordsValidator;
class ReservedWordsCommand extends Command class ReservedWordsCommand extends Command
{ {
private $keywordListClasses = array( private $keywordListClasses = array(
'mysql' => 'Doctrine\DBAL\Platforms\Keywords\MySQLKeywords', 'mysql' => 'Doctrine\DBAL\Platforms\Keywords\MySQLKeywords',
'sqlserver' => 'Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords', 'sqlserver' => 'Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords',
'sqlite' => 'Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords', 'sqlserver2005' => 'Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords',
'pgsql' => 'Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords', 'sqlserver2008' => 'Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords',
'oracle' => 'Doctrine\DBAL\Platforms\Keywords\OracleKeywords', 'sqlserver2012' => 'Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords',
'db2' => 'Doctrine\DBAL\Platforms\Keywords\DB2Keywords', 'sqlite' => 'Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords',
'pgsql' => 'Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords',
'oracle' => 'Doctrine\DBAL\Platforms\Keywords\OracleKeywords',
'db2' => 'Doctrine\DBAL\Platforms\Keywords\DB2Keywords',
); );
/** /**
...@@ -83,6 +86,9 @@ The following keyword lists are currently shipped with Doctrine: ...@@ -83,6 +86,9 @@ The following keyword lists are currently shipped with Doctrine:
* sqlite * sqlite
* oracle * oracle
* sqlserver * sqlserver
* sqlserver2005
* sqlserver2008
* sqlserver2012
* db2 (Not checked by default) * db2 (Not checked by default)
EOT EOT
); );
...@@ -98,7 +104,16 @@ EOT ...@@ -98,7 +104,16 @@ EOT
$keywordLists = (array)$input->getOption('list'); $keywordLists = (array)$input->getOption('list');
if ( ! $keywordLists) { if ( ! $keywordLists) {
$keywordLists = array('mysql', 'pgsql', 'sqlite', 'oracle', 'sqlserver'); $keywordLists = array(
'mysql',
'pgsql',
'sqlite',
'oracle',
'sqlserver',
'sqlserver2005',
'sqlserver2008',
'sqlserver2012'
);
} }
$keywords = array(); $keywords = array();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment