Skip to content
This repository was archived by the owner on Feb 16, 2022. It is now read-only.

Commit d5e57c7

Browse files
committed
Merge tag 'v1.0.1' into develop
no message * tag 'v1.0.1': Bump version Fix MySQL / PostgreSQL json column compatibility Add PHP 7.3 support to travis
2 parents 2632890 + 63c1022 commit d5e57c7

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: php
33
php:
44
- 7.1
55
- 7.2
6+
- 7.3
67

78
env:
89
matrix:

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
This project adheres to [Semantic Versioning](CONTRIBUTING.md).
66

77

8+
## [v1.0.1] - 2018-12-22
9+
- Add missing use statement
10+
- Update composer dependencies
11+
- Add PHP 7.3 support to travis
12+
- Fix MySQL / PostgreSQL json column compatibility
13+
814
## [v1.0.0] - 2018-10-01
915
- Enforce Consistency
1016
- Support Laravel 5.7+
@@ -70,6 +76,7 @@ This project adheres to [Semantic Versioning](CONTRIBUTING.md).
7076
## v0.0.1 - 2017-09-08
7177
- Tag first release
7278

79+
[v1.0.1]: https://github.com/rinvex/laravel-bookings/compare/v1.0.0...v1.0.1
7380
[v1.0.0]: https://github.com/rinvex/laravel-bookings/compare/v0.0.3...v1.0.0
7481
[v0.0.3]: https://github.com/rinvex/laravel-bookings/compare/v0.0.2...v0.0.3
7582
[v0.0.2]: https://github.com/rinvex/laravel-bookings/compare/v0.0.1...v0.0.2

database/migrations/2017_06_27_143745_create_bookable_bookings_table.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ public function down(): void
5353
*/
5454
protected function jsonable(): string
5555
{
56-
return DB::connection()->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME) === 'mysql'
57-
&& version_compare(DB::connection()->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), '5.7.8', 'ge')
58-
? 'json' : 'text';
56+
$driverName = DB::connection()->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME);
57+
$dbVersion = DB::connection()->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
58+
$isOldVersion = version_compare($dbVersion, '5.7.8', 'lt');
59+
60+
return $driverName === 'mysql' && $isOldVersion ? 'text' : 'json';
5961
}
6062
}

database/migrations/2018_04_04_154842_create_ticketable_tickets_table.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ public function down()
4949
*/
5050
protected function jsonable(): string
5151
{
52-
return DB::connection()->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME) === 'mysql'
53-
&& version_compare(DB::connection()->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), '5.7.8', 'ge')
54-
? 'json' : 'text';
52+
$driverName = DB::connection()->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME);
53+
$dbVersion = DB::connection()->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
54+
$isOldVersion = version_compare($dbVersion, '5.7.8', 'lt');
55+
56+
return $driverName === 'mysql' && $isOldVersion ? 'text' : 'json';
5557
}
5658
}

src/Traits/Bookable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace Rinvex\Bookings\Traits;
66

7+
use Carbon\Carbon;
78
use Illuminate\Database\Eloquent\Model;
89
use Rinvex\Bookings\Models\BookableBooking;
910
use Illuminate\Database\Eloquent\Relations\MorphMany;
10-
use Carbon\Carbon;
1111

1212
trait Bookable
1313
{

0 commit comments

Comments
 (0)