Skip to content

Commit

Permalink
fix: convert "NULL" values to null for mariadb
Browse files Browse the repository at this point in the history
  • Loading branch information
WatheqAlshowaiter committed Jul 20, 2024
1 parent 39b2d7d commit 5b632d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/RequiredFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public static function getRequiredFields(
}

if (DB::connection()->getDriverName() == 'mariadb') { // mariadb has special case for nullables
dump(
Schema::getColumns((new self())->getTable()) // todo remove it later
);
return self::getRequiredFieldsForOlderVersions(
$withNullables,
$withDefaults,
Expand All @@ -44,9 +47,6 @@ public static function getRequiredFields(
->flatten()
->toArray();

dump(
Schema::getColumns((new self())->getTable()) // todo remove it later
);
return collect(Schema::getColumns((new self())->getTable()))
->reject(function ($column) use ($primaryIndex, $withNullables, $withDefaults) {
return
Expand Down
1 change: 1 addition & 0 deletions todos.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
- [x] 7.4
- [x] add GitHub action for all supported laravel versions with each php
- [x] add methods to include nullables, defaults, and primaryKeys
- [x] fix issues with mariadb database
- [ ] test code for SQL server
- [ ] add GitHub action for all supported SQL databases

0 comments on commit 5b632d5

Please sign in to comment.