Add Notification Token

This commit is contained in:
R
2022-11-22 10:19:37 +07:00
parent 9a0032ae17
commit 05ae09ab4c
6 changed files with 223 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notification_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('notifiabletoken', 'notifiabletoken');
$table->string('origin');
$table->string('type');
$table->string('token');
$table->string('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notification_tokens');
}
};

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('api_logs', function (Blueprint $table) {
$table->id();
$table->string('type')->comment('in or out');
$table->string('context')->nullable();
$table->string('target')->comment('url or path that got hit');
$table->text('request');
$table->text('response')->nullable();
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable()->index();
$table->unsignedBigInteger('updated_by')->nullable()->index();
$table->unsignedBigInteger('deleted_by')->nullable()->index();
$table->index('token');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('api_logs');
}
};