diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 70d8e7b..056063f 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -14,7 +14,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.6.0 + uses: dependabot/fetch-metadata@v2.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index cd4239c..56d54d3 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -20,7 +20,7 @@ jobs: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@2.3.1 + uses: aglipanci/laravel-pint-action@2.4 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/CHANGELOG.md b/CHANGELOG.md index 30b663d..ff1c5b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to `laravel-schema-macros` will be documented in this file. +## v1.1.4 - 2024-03-14 + +### What's Changed + +* Bump ramsey/composer-install from 2 to 3 by @dependabot in https://github.com/envor/laravel-schema-macros/pull/8 +* Support Mariadb Builder by @inmanturbo in https://github.com/envor/laravel-schema-macros/pull/9 + +### New Contributors + +* @dependabot made their first contribution in https://github.com/envor/laravel-schema-macros/pull/8 + +**Full Changelog**: https://github.com/envor/laravel-schema-macros/compare/v1.1.3...v1.1.4 + ## v1.1.3 - 2024-02-15 **Full Changelog**: https://github.com/envor/laravel-schema-macros/compare/v1.1.1...v1.1.3 diff --git a/src/PgSql/PgSqlCreateDatabaseIfNotExists.php b/src/PgSql/PgSqlCreateDatabaseIfNotExists.php new file mode 100644 index 0000000..b5af58d --- /dev/null +++ b/src/PgSql/PgSqlCreateDatabaseIfNotExists.php @@ -0,0 +1,31 @@ +databaseExists($database)) { + return false; + } + + return $this->createDatabase($database); + }; + } +} diff --git a/src/PgSql/PgSqlDatabaseExists.php b/src/PgSql/PgSqlDatabaseExists.php new file mode 100644 index 0000000..b6547b5 --- /dev/null +++ b/src/PgSql/PgSqlDatabaseExists.php @@ -0,0 +1,27 @@ +getConnection()->select("SELECT datname FROM pg_database WHERE datname = '{$database}'"); + }; + } +} diff --git a/src/SchemaMacrosCollection.php b/src/SchemaMacrosCollection.php index e5b29f4..e178211 100644 --- a/src/SchemaMacrosCollection.php +++ b/src/SchemaMacrosCollection.php @@ -4,6 +4,4 @@ use Illuminate\Support\Collection; -class SchemaMacrosCollection extends Collection -{ -} +class SchemaMacrosCollection extends Collection {} diff --git a/src/SchemaMacrosServiceProvider.php b/src/SchemaMacrosServiceProvider.php index 9b4eedc..f54a9aa 100644 --- a/src/SchemaMacrosServiceProvider.php +++ b/src/SchemaMacrosServiceProvider.php @@ -34,11 +34,13 @@ private function macros(): array 'sqlite' => \Envor\SchemaMacros\SQLite\SQLiteDatabaseExists::class, 'mysql' => \Envor\SchemaMacros\MySql\MySqlDatabaseExists::class, 'mariadb' => \Envor\SchemaMacros\MariaDb\MariaDbDatabaseExists::class, + 'pgsql' => \Envor\SchemaMacros\PgSql\PgSqlDatabaseExists::class, ], 'createDatabaseIfNotExists' => [ 'sqlite' => \Envor\SchemaMacros\SQLite\SQLiteCreateDatabaseIfNotExists::class, 'mysql' => \Envor\SchemaMacros\MySql\MySqlCreateDatabaseIfNotExists::class, 'mariadb' => \Envor\SchemaMacros\MariaDb\MariaDbCreateDatabaseIfNotExists::class, + 'pgsql' => \Envor\SchemaMacros\PgSql\PgSqlCreateDatabaseIfNotExists::class, ], 'trashDatabase' => [ 'sqlite' => \Envor\SchemaMacros\SQLite\SQLiteTrashDatabase::class, diff --git a/src/UnsupportedDriver.php b/src/UnsupportedDriver.php index c85d280..7a490d9 100644 --- a/src/UnsupportedDriver.php +++ b/src/UnsupportedDriver.php @@ -4,6 +4,4 @@ use Exception; -class UnsupportedDriver extends Exception -{ -} +class UnsupportedDriver extends Exception {}