-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ing-the-db-server-version Allow overriding the db server version
- Loading branch information
Showing
6 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* @link https://craftcms.com/ | ||
* @copyright Copyright (c) Pixel & Tonic, Inc. | ||
* @license https://craftcms.github.io/license/ | ||
*/ | ||
|
||
namespace craft\db; | ||
|
||
use craft\db\mysql\Schema as MysqlSchema; | ||
use craft\db\pgsql\Schema as PgsqlSchema; | ||
|
||
/** | ||
* SchemaTrait | ||
* | ||
* @mixin MysqlSchema | ||
* @mixin PgsqlSchema | ||
* @author Pixel & Tonic, Inc. <[email protected]> | ||
* @since 4.3.0 | ||
*/ | ||
trait SchemaTrait | ||
{ | ||
/** | ||
* @see getServerVersion() | ||
* @see setServerVersion() | ||
*/ | ||
private ?string $version = null; | ||
|
||
/** | ||
* Returns the database server version. | ||
* | ||
* @return string | ||
*/ | ||
public function getServerVersion(): string | ||
{ | ||
return $this->version ?? parent::getServerVersion(); | ||
} | ||
|
||
/** | ||
* Sets the database server version. | ||
* | ||
* @param string $version | ||
*/ | ||
public function setServerVersion(string $version): void | ||
{ | ||
$this->version = $version; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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