datatable.directory codebase
https://datatable.directory/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
932 B
40 lines
932 B
6 years ago
|
<?php
|
||
|
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
||
|
class CreateSessionsTable extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('sessions', function (Blueprint $table) {
|
||
|
$table->string('id')->unique();
|
||
|
$table->unsignedInteger('user_id')->nullable();
|
||
|
$table->string('ip_address', 45)->nullable();
|
||
|
$table->text('user_agent')->nullable();
|
||
|
$table->text('payload');
|
||
|
$table->integer('last_activity');
|
||
|
|
||
|
$table->foreign('user_id')
|
||
|
->references('id')->on('users')
|
||
|
->onDelete('cascade');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('sessions');
|
||
|
}
|
||
|
}
|