Closed achretien closed 3 years ago
Moved to primary Yii 2 repository since it seems to be only MSSQL returning already quoted table names from schema. No other driver does that. I think the fix should be moving the quoting to higher layers and returning un-quoted names from schema itself.
Just patching Gii isn't a good solution.
@alexkart, @darkdef would you please check this one?
@alexkart May be speak about this issue in tg or slack?
What steps will reproduce the problem?
Using a wildcard in model name generation with a SqlServer DB
What's expected?
finding at least one table
What do you get instead?
finding nothing
Additional info
Since https://github.com/yiisoft/yii2/commit/6b10bbcec29b8c60e754a8b2cc0dc83e7c8d5d3e#diff-ea76a30d7da4b9fb69fe63d479c0764c4fd9bf99fbb859ba664ff0bc79a6bf8c
The table name return by the driver are like
[tableName]
instead oftableName
.In https://github.com/yiisoft/yii2-gii/blob/aa5307c827e47ea5673da9bd9214bb1c7cc118bc/src/generators/model/Generator.php#L959
we test
/^\w+$/
against a table name starting with[