Skip to content

Commit

Permalink
Fixes #19 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
MTEXX authored Mar 19, 2021
1 parent 28aba6d commit 69a32b0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 1,12 @@
language: php

php:
- 7.2
- 7.3
- 7.4
- 8.0

dist: trusty
sudo: false

install: travis_retry composer install --no-interaction --prefer-source

script: ./vendor/bin/phpunit --verbose --coverage-text
script: ./vendor/bin/phpunit --verbose --coverage-text
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 4,8 @@
"require": {
"php": "^7.4|^8.0",
"laravel/framework": "^5.8|^6.20.14|^7.0|^8.0",
"sebastian/diff": "^3.0|^4.0"
"sebastian/diff": "^3.0|^4.0",
"doctrine/dbal": "^2.12"
},
"require-dev": {
"phpunit/phpunit": "^8.1|^9.0",
Expand Down
32 changes: 32 additions & 0 deletions migrations/2021_03_18_160750_make_user_nullable.php
Original file line number Diff line number Diff line change
@@ -0,0 1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class MakeUserNullable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('versions', function (Blueprint $table) {
$table->unsignedBigInteger(config('versionable.user_foreign_key', 'user_id'))->nullable()->change();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('versions', function (Blueprint $table) {
$table->unsignedBigInteger(config('versionable.user_foreign_key', 'user_id'))->nullable(false)->change();
});
}
}
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 23,7 @@ class Version extends Model
];

/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo|null
*/
public function user()
{
Expand Down

0 comments on commit 69a32b0

Please sign in to comment.