Skip to content

Change PHP constraint to 8.1 - 8.5 + Yii DB 2#83

Merged
vjik merged 20 commits intomasterfrom
php85
Jan 21, 2026
Merged

Change PHP constraint to 8.1 - 8.5 + Yii DB 2#83
vjik merged 20 commits intomasterfrom
php85

Conversation

@vjik
Copy link
Copy Markdown
Member

@vjik vjik commented Jan 19, 2026

Q A
Is bugfix?
New feature?
Breaks BC?

@vjik vjik added the status:under development Someone is working on a pull request. label Jan 19, 2026
@vjik vjik changed the title Change PHP constraint to 8.1 - 8.5 Change PHP constraint to 8.1 - 8.5 + Yii DB 2 Jan 20, 2026
@vjik vjik mentioned this pull request Jan 20, 2026
@vjik vjik added status:code review The pull request needs review. and removed status:under development Someone is working on a pull request. labels Jan 20, 2026
@vjik vjik requested review from a team and Tigrov January 20, 2026 09:49
Copy link
Copy Markdown
Member

@Tigrov Tigrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]])",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ($this->hasTable($tableMessage)) {
if ($schema->hasTable($tableMessage)) {

}
}

if ($this->hasTable($tableSourceMessage)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@vjik
Copy link
Copy Markdown
Member Author

vjik commented Jan 21, 2026

DbSchemaManager::createSchema() should be refactored, perhaps in another PR.

We decided to do this in separate PR

@vjik vjik merged commit 41a275f into master Jan 21, 2026
72 checks passed
@vjik vjik deleted the php85 branch January 21, 2026 07:40
@vjik vjik mentioned this pull request Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants