id(); $t->foreignId('company_id')->nullable()->constrained()->cascadeOnDelete(); $t->foreignId('user_id')->nullable()->constrained()->cascadeOnDelete(); $t->string('endpoint', 500); $t->string('public_key')->nullable(); // p256dh $t->string('auth_token')->nullable(); // auth $t->string('content_encoding', 32)->default('aesgcm'); $t->string('user_agent')->nullable(); $t->timestamps(); $t->unique('endpoint', 'push_subscriptions_endpoint_unique'); $t->index(['company_id', 'user_id']); }); } public function down(): void { Schema::dropIfExists('push_subscriptions'); } };