add ejaculations.checkin_webhook_id
This commit is contained in:
		| @@ -19,7 +19,8 @@ class Ejaculation extends Model | |||||||
|     protected $fillable = [ |     protected $fillable = [ | ||||||
|         'user_id', 'ejaculated_date', |         'user_id', 'ejaculated_date', | ||||||
|         'note', 'geo_latitude', 'geo_longitude', 'link', 'source', |         'note', 'geo_latitude', 'geo_longitude', 'link', 'source', | ||||||
|         'is_private', 'is_too_sensitive' |         'is_private', 'is_too_sensitive', | ||||||
|  |         'checkin_webhook_id' | ||||||
|     ]; |     ]; | ||||||
|  |  | ||||||
|     protected $dates = [ |     protected $dates = [ | ||||||
|   | |||||||
| @@ -67,7 +67,8 @@ class WebhookController extends Controller | |||||||
|             'link' => $inputs['link'] ?? '', |             'link' => $inputs['link'] ?? '', | ||||||
|             'source' => Ejaculation::SOURCE_WEBHOOK, |             'source' => Ejaculation::SOURCE_WEBHOOK, | ||||||
|             'is_private' => $request->has('is_private') ?? false, |             '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 = []; |         $tagIds = []; | ||||||
|   | |||||||
| @@ -21,6 +21,7 @@ class CreateCheckinWebhooksTable extends Migration | |||||||
|             $table->softDeletes(); |             $table->softDeletes(); | ||||||
|  |  | ||||||
|             $table->primary('id'); |             $table->primary('id'); | ||||||
|  |             $table->index('user_id'); | ||||||
|  |  | ||||||
|             $table->foreign('user_id')->references('id')->on('users')->onDelete('set null'); |             $table->foreign('user_id')->references('id')->on('users')->onDelete('set null'); | ||||||
|         }); |         }); | ||||||
|   | |||||||
| @@ -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'); | ||||||
|  |         }); | ||||||
|  |     } | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user
	 shibafu
					shibafu