add ejaculations.checkin_webhook_id

This commit is contained in:
shibafu 2020-07-24 12:12:35 +09:00
parent 94446e0174
commit ef18d26b5d
4 changed files with 37 additions and 2 deletions

View File

@ -19,7 +19,8 @@ class Ejaculation extends Model
protected $fillable = [
'user_id', 'ejaculated_date',
'note', 'geo_latitude', 'geo_longitude', 'link', 'source',
'is_private', 'is_too_sensitive'
'is_private', 'is_too_sensitive',
'checkin_webhook_id'
];
protected $dates = [

View File

@ -67,7 +67,8 @@ class WebhookController extends Controller
'link' => $inputs['link'] ?? '',
'source' => Ejaculation::SOURCE_WEBHOOK,
'is_private' => $request->has('is_private') ?? false,
'is_too_sensitive' => $request->has('is_too_sensitive') ?? false
'is_too_sensitive' => $request->has('is_too_sensitive') ?? false,
'checkin_webhook_id' => $webhook->id
]);
$tagIds = [];

View File

@ -21,6 +21,7 @@ class CreateCheckinWebhooksTable extends Migration
$table->softDeletes();
$table->primary('id');
$table->index('user_id');
$table->foreign('user_id')->references('id')->on('users')->onDelete('set null');
});

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCheckinWebhookIdToEjaculations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ejaculations', function (Blueprint $table) {
$table->string('checkin_webhook_id', 64)->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ejaculations', function (Blueprint $table) {
$table->dropColumn('checkin_webhook_id');
});
}
}