Skip to content

Commit

Permalink
🔧 Fix migrations ♻️ Clean models and traits ✅ PHP 7.4 CI
Browse files Browse the repository at this point in the history
  • Loading branch information
MarceauKa committed Jan 2, 2020
1 parent 03b992e commit d2eaff9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: php
php:
- 7.4
- 7.3
- 7.2
before_script: composer install
Expand Down
2 changes: 2 additions & 0 deletions migrations/create_devices_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class CreateDevicesTable extends Migration
$table->boolean('is_trusted')->default(0)->index();
$table->boolean('is_untrusted')->default(0)->index();
$table->timestamps();

// $table->index(['user_id', 'user_type']);
});
}

Expand Down
4 changes: 2 additions & 2 deletions migrations/create_logins_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ class CreateLoginsTable extends Migration
Schema::create('logins', function (Blueprint $table) {
$table->bigIncrements('id');
$table->ipAddress('ip_address');
$table->string('type')->default(\Lab404\AuthChecker\Models\Login::TYPE_LOGIN)->index();
$table->string('type')->default(\Lab404\AuthChecker\Models\Login::TYPE_LOGIN);
$table->bigInteger('user_id')->unsigned();
$table->string('user_type');
$table->bigInteger('device_id')->unsigned()->index()->nullable();
$table->timestamps();

// $table->foreign('device_id')->references('id')->on('devices')->onDelete('cascade');
// $table->index(['user_id', 'user_type']);
});
}

Expand Down
2 changes: 0 additions & 2 deletions src/Models/Device.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
namespace Lab404\AuthChecker\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\MorphOne;
use Illuminate\Database\Eloquent\Relations\MorphTo;

/**
Expand Down
1 change: 0 additions & 1 deletion src/Models/HasLoginsAndDevices.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Lab404\AuthChecker\Models;

use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;

/**
Expand Down

0 comments on commit d2eaff9

Please sign in to comment.