Skip to content

Commit

Permalink
feat: Add Laravel 10 Support (#77)
Browse files Browse the repository at this point in the history
* build(deps): Add Laravel 10 support

* ci: Run on PHP 8.1

* build(deps): Require PHPUnit 9.6

* fix: Use getValues explicitly
  • Loading branch information
siketyan authored Mar 15, 2023
1 parent d590d99 commit d96bf4b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,30 @@ jobs:
coverage: false
experimental: false
exclude_group: WithoutSchema,forPHP7
- operating_system: 'ubuntu-latest'
php_versions: '8.1'
postgres: '10'
experimental: false
coverage: false
exclude_group: WithoutSchema,forPHP7
- operating_system: 'ubuntu-latest'
php_versions: '8.1'
postgres: '11'
experimental: false
coverage: false
exclude_group: WithoutSchema,forPHP7
- operating_system: 'ubuntu-latest'
php_versions: '8.1'
postgres: '12'
experimental: false
coverage: true
exclude_group: WithoutSchema,forPHP7
- operating_system: 'ubuntu-latest'
php_versions: '8.1'
postgres: '13'
coverage: false
experimental: false
exclude_group: WithoutSchema,forPHP7
runs-on: '${{ matrix.operating_system }}'
services:
postgres:
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@
"ext-pdo": "*",
"php": "^7.2|^7.3|^7.4|^8.0",
"doctrine/dbal": "^2.9|^3.0",
"laravel/framework": "^5.8|^6.0|^7.0|^8.0|^9.0"
"laravel/framework": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0"
},
"require-dev": {
"umbrellio/code-style-php": "^1.0",
"orchestra/testbench": "^3.5|^6.0|^4.0|^7.0",
"orchestra/testbench": "^3.5|^6.0|^4.0|^7.0|^8.0",
"php-coveralls/php-coveralls": "^2.1",
"codeception/codeception": "^3.0|^4.0|^5.0.0-RC7"
"codeception/codeception": "^3.0|^4.0|^5.0",
"phpunit/phpunit": "^9.6"
},
"scripts": {
"lint": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Doctrine\DBAL\Types\IntegerType;
use Illuminate\Database\Query\Expression;
use Illuminate\Support\Collection;
use Umbrellio\Postgres\Schema\Grammars\PostgresGrammar;

final class SchemaAlterTableChangeColumnSubscriber implements EventSubscriber
{
Expand Down Expand Up @@ -197,8 +198,9 @@ public function compileAlterColumnType(

public function getDefaultValueDeclarationSQL(AbstractPlatform $platform, Column $column): string
{
if ($column->getDefault() instanceof Expression) {
return ' DEFAULT ' . $column->getDefault();
$defaultValue = $column->getDefault();
if ($defaultValue instanceof Expression) {
return ' DEFAULT ' . $defaultValue->getValue(new PostgresGrammar());
}

return $platform->getDefaultValueDeclarationSQL($column->toArray());
Expand Down

0 comments on commit d96bf4b

Please sign in to comment.