mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2024-12-12 10:16:19 +01:00
38 lines
906 B
PHP
38 lines
906 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
||
|
class CreateVisitsTable extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('visits', function (Blueprint $table) {
|
||
|
$table->bigIncrements('id');
|
||
|
$table->string('primary_key');
|
||
|
$table->string('secondary_key')->nullable();
|
||
|
$table->unsignedBigInteger('score');
|
||
|
$table->json('list')->nullable();
|
||
|
$table->timestamp('expired_at')->nullable();
|
||
|
$table->timestamps();
|
||
|
$table->unique(['primary_key', 'secondary_key']);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('visits');
|
||
|
}
|
||
|
}
|