Conversation
Member
vjik
commented
Jan 19, 2026
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ❌ |
| Breaks BC? | ❌ |
Tigrov
approved these changes
Jan 20, 2026
8.1 - 8.58.1 - 8.5 + Yii DB 2
Closed
samdark
approved these changes
Jan 20, 2026
Tigrov
reviewed
Jan 21, 2026
Member
Tigrov
left a comment
There was a problem hiding this comment.
DbSchemaManager::createSchema() should be refactored, perhaps in another PR.
Comment on lines
233
to
243
| $updateAction = 'RESTRICT'; | ||
|
|
||
| if ($driverName === 'sqlsrv') { | ||
| // 'NO ACTION' is equal to 'RESTRICT' in `MSSQL`. | ||
| $updateAction = 'NO ACTION'; | ||
| } | ||
|
|
||
| if ($driverName === 'oci') { | ||
| // Oracle doesn't support action for update. | ||
| $updateAction = null; | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| $updateAction = match ($driverName) { | |
| // MSSQL does not support `RESTRICT` keyword but uses this behavior by default. | |
| // Oracle doesn't support action for update. | |
| 'sqlsrv', 'oci' => null, | |
| default => ReferentialAction::RESTRICT, | |
| }; |
Comment on lines
+322
to
326
| 'id' => $columnBuilder::integer()->notNull(), | ||
| 'category' => $columnBuilder::string(), | ||
| 'message_id' => $columnBuilder::text(), | ||
| 'comment' => $columnBuilder::text(), | ||
| "CONSTRAINT [[PK_{$tableRawNameSourceMessage}]] PRIMARY KEY ([[id]])", |
Member
There was a problem hiding this comment.
Suggested change
| 'id' => $columnBuilder::integer()->notNull(), | |
| 'category' => $columnBuilder::string(), | |
| 'message_id' => $columnBuilder::text(), | |
| 'comment' => $columnBuilder::text(), | |
| "CONSTRAINT [[PK_{$tableRawNameSourceMessage}]] PRIMARY KEY ([[id]])", | |
| 'id' => $columnBuilder::primaryKey(), | |
| 'category' => $columnBuilder::string(), | |
| 'message_id' => $columnBuilder::text(), | |
| 'comment' => $columnBuilder::text(), |
| $tableRawNameSourceMessage = $quoter->getRawTableName($tableSourceMessage); | ||
| $tableRawNameMessage = $quoter->getRawTableName($tableMessage); | ||
|
|
||
| if ($this->hasTable($tableSourceMessage) && $this->hasTable($tableMessage)) { |
Member
There was a problem hiding this comment.
Suggested change
| if ($this->hasTable($tableSourceMessage) && $this->hasTable($tableMessage)) { | |
| if ($schema->hasTable($tableSourceMessage) && $schema->hasTable($tableMessage)) { |
| $tableRawNameSourceMessage = $quoter->getRawTableName($tableSourceMessage); | ||
| $tableRawNameMessage = $quoter->getRawTableName($tableMessage); | ||
|
|
||
| if ($this->hasTable($tableMessage)) { |
Member
There was a problem hiding this comment.
Suggested change
| if ($this->hasTable($tableMessage)) { | |
| if ($schema->hasTable($tableMessage)) { |
| } | ||
| } | ||
|
|
||
| if ($this->hasTable($tableSourceMessage)) { |
Member
There was a problem hiding this comment.
Suggested change
| if ($schema->hasTable($tableSourceMessage)) { |
Comment on lines
348
to
359
|
|
||
| /** | ||
| * Checks if the given table exists in the database. | ||
| * | ||
| * @param string $table The name of the table to check. | ||
| * | ||
| * @return bool Whether the table exists or not. | ||
| */ | ||
| private function hasTable(string $table): bool | ||
| { | ||
| return $this->db->getTableSchema($table, true) !== null; | ||
| } |
Member
Author
We decided to do this in separate PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.