-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
chore(deps): Bump doctrine/dbal to 3.7.x #38556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
18d672c
chore(deps): Bump doctrine/dbal to supported 3.7.0
nickvergessen c4ed7f9
fix(dbal): Doctrine\DBAL\Connection::PARAM_* types are deprecated
nickvergessen 00acf1b
feat(CI): Add a stub for SensitiveParameter, so Psalm is not failing …
nickvergessen ad839db
fix(sqlite): Remove no longer required autoincrement fix
nickvergessen b202b13
fix(postgres): Remove old Postgres 9.4 workaround
nickvergessen 160298c
fix(mysql): Remove custom MySQL workaround from 2015
nickvergessen 9192078
fix(dbal): Move migrator away from deprecated calls
nickvergessen f8ee6c4
fix(oracle): Move away from internal and deprecated SchemaDiff API
nickvergessen ccb01b1
fix(sqlite): Remove some old SQLite cheats
nickvergessen 570159e
fix(DB): Update comment to state why we still use the max 4k limit
nickvergessen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?php | ||
|
|
||
| #[\Attribute(Attribute::TARGET_PARAMETER)] | ||
| class SensitiveParameter { | ||
| } |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,6 @@ | |
| use Doctrine\DBAL\Exception; | ||
| use Doctrine\DBAL\Platforms\MySQLPlatform; | ||
| use Doctrine\DBAL\Schema\AbstractAsset; | ||
| use Doctrine\DBAL\Schema\Comparator; | ||
| use Doctrine\DBAL\Schema\Schema; | ||
| use Doctrine\DBAL\Schema\SchemaDiff; | ||
| use Doctrine\DBAL\Types\StringType; | ||
|
|
@@ -75,7 +74,7 @@ public function generateChangeScript(Schema $targetSchema) { | |
| $schemaDiff = $this->getDiff($targetSchema, $this->connection); | ||
|
|
||
| $script = ''; | ||
| $sqls = $schemaDiff->toSql($this->connection->getDatabasePlatform()); | ||
| $sqls = $this->connection->getDatabasePlatform()->getAlterSchemaSQL($schemaDiff); | ||
| foreach ($sqls as $sql) { | ||
| $script .= $this->convertStatementToScript($sql); | ||
| } | ||
|
|
@@ -95,18 +94,20 @@ public function createSchema() { | |
| } | ||
| return preg_match($filterExpression, $asset) === 1; | ||
| }); | ||
| return $this->connection->getSchemaManager()->createSchema(); | ||
| return $this->connection->createSchemaManager()->introspectSchema(); | ||
| } | ||
|
|
||
| /** | ||
| * @return SchemaDiff | ||
| */ | ||
| protected function getDiff(Schema $targetSchema, Connection $connection) { | ||
| // adjust varchar columns with a length higher then getVarcharMaxLength to clob | ||
| // Adjust STRING columns with a length higher than 4000 to TEXT (clob) | ||
| // for consistency between the supported databases and | ||
| // old vs. new installations. | ||
| foreach ($targetSchema->getTables() as $table) { | ||
| foreach ($table->getColumns() as $column) { | ||
| if ($column->getType() instanceof StringType) { | ||
| if ($column->getLength() > $connection->getDatabasePlatform()->getVarcharMaxLength()) { | ||
| if ($column->getLength() > 4000) { | ||
nickvergessen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| $column->setType(Type::getType('text')); | ||
| $column->setLength(null); | ||
| } | ||
|
|
@@ -122,7 +123,7 @@ protected function getDiff(Schema $targetSchema, Connection $connection) { | |
| } | ||
| return preg_match($filterExpression, $asset) === 1; | ||
| }); | ||
| $sourceSchema = $connection->getSchemaManager()->createSchema(); | ||
| $sourceSchema = $connection->createSchemaManager()->introspectSchema(); | ||
|
|
||
| // remove tables we don't know about | ||
| foreach ($sourceSchema->getTables() as $table) { | ||
|
|
@@ -137,9 +138,8 @@ protected function getDiff(Schema $targetSchema, Connection $connection) { | |
| } | ||
| } | ||
|
|
||
| /** @psalm-suppress InternalMethod */ | ||
| $comparator = new Comparator(); | ||
| return $comparator->compare($sourceSchema, $targetSchema); | ||
| $comparator = $connection->createSchemaManager()->createComparator(); | ||
| return $comparator->compareSchemas($sourceSchema, $targetSchema); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -155,7 +155,7 @@ protected function applySchema(Schema $targetSchema, Connection $connection = nu | |
| if (!$connection->getDatabasePlatform() instanceof MySQLPlatform) { | ||
| $connection->beginTransaction(); | ||
| } | ||
| $sqls = $schemaDiff->toSql($connection->getDatabasePlatform()); | ||
| $sqls = $connection->getDatabasePlatform()->getAlterSchemaSQL($schemaDiff); | ||
| $step = 0; | ||
| foreach ($sqls as $sql) { | ||
| $this->emit($sql, $step++, count($sqls)); | ||
|
|
@@ -178,7 +178,7 @@ protected function convertStatementToScript($statement) { | |
| } | ||
|
|
||
| protected function getFilterExpression() { | ||
| return '/^' . preg_quote($this->config->getSystemValueString('dbtableprefix', 'oc_')) . '/'; | ||
| return '/^' . preg_quote($this->config->getSystemValueString('dbtableprefix', 'oc_'), '/') . '/'; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤷 |
||
| } | ||
|
|
||
| protected function emit(string $sql, int $step, int $max): void { | ||
|
|
||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.