mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-11 19:20:01 +08:00
Fix #18041: Fix RBAC migration for MSSQL
This commit is contained in:
@@ -9,6 +9,7 @@ Yii Framework 2 Change Log
|
|||||||
- Bug #18026: Fix `ArrayHelper::getValue()` did not work with `ArrayAccess` objects (mikk150)
|
- Bug #18026: Fix `ArrayHelper::getValue()` did not work with `ArrayAccess` objects (mikk150)
|
||||||
- Enh #18048: Use `Instance::ensure()` to set `User::$accessChecker` (lav45)
|
- Enh #18048: Use `Instance::ensure()` to set `User::$accessChecker` (lav45)
|
||||||
- Bug #18051: Fix missing support for custom validation method in EachValidator (bizley)
|
- Bug #18051: Fix missing support for custom validation method in EachValidator (bizley)
|
||||||
|
- Bug #18041: Fix RBAC migration for MSSQL (darkdef)
|
||||||
|
|
||||||
|
|
||||||
2.0.35 May 02, 2020
|
2.0.35 May 02, 2020
|
||||||
|
|||||||
@@ -41,15 +41,11 @@ class m200409_110543_rbac_update_mssql_trigger extends Migration
|
|||||||
->from(['fkc' => 'sys.foreign_key_columns'])
|
->from(['fkc' => 'sys.foreign_key_columns'])
|
||||||
->innerJoin(['c' => 'sys.columns'], 'fkc.parent_object_id = c.object_id AND fkc.parent_column_id = c.column_id')
|
->innerJoin(['c' => 'sys.columns'], 'fkc.parent_object_id = c.object_id AND fkc.parent_column_id = c.column_id')
|
||||||
->innerJoin(['r' => 'sys.columns'], 'fkc.referenced_object_id = r.object_id AND fkc.referenced_column_id = r.column_id')
|
->innerJoin(['r' => 'sys.columns'], 'fkc.referenced_object_id = r.object_id AND fkc.referenced_column_id = r.column_id')
|
||||||
->where(
|
->andWhere('fkc.parent_object_id=OBJECT_ID(:fkc_parent_object_id)',[':fkc_parent_object_id' => $this->db->schema->getRawTableName($table)])
|
||||||
[
|
->andWhere('fkc.referenced_object_id=OBJECT_ID(:fkc_referenced_object_id)',[':fkc_referenced_object_id' => $this->db->schema->getRawTableName($referenceTable)])
|
||||||
'AND',
|
->andWhere(['c.name' => $column])
|
||||||
['fkc.parent_object_id' => $this->db->schema->getRawTableName($table)],
|
->andWhere(['r.name' => $referenceColumn])
|
||||||
['fkc.referenced_object_id' => $this->db->schema->getRawTableName($referenceTable)],
|
->scalar($this->db);
|
||||||
['c.name' => $column],
|
|
||||||
['r.name' => $referenceColumn],
|
|
||||||
]
|
|
||||||
)->scalar($this->db);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user