mirror of
https://github.com/projectsend/projectsend.git
synced 2026-10-23 12:47:53 +00:00
6e47d76ba6
Client file sharing, rebuilt from the ground up: a private area per client, resumable uploads, folders, groups and categories, sharing with expiry dates and download limits, comments, file versions, an activity log, a REST API, and sixteen languages. This repository begins here. ProjectSend 2 was developed privately, and that development history is not published — the previous generation remains available, with its own history, at projectsend/legacy. Free software under the GNU General Public License v2, or (at your option) any later version.
38 lines
1.3 KiB
PHP
38 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('notifications', function (Blueprint $table) {
|
|
$table->id();
|
|
// Plain FK, not polymorphic: there's exactly one Notifiable
|
|
// model in this app (User, staff+client via UserType) — see
|
|
// ActivityLog's actor_id for the same reasoning.
|
|
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
|
|
// A NotificationTypeRegistry key (e.g. 'file_shared'), not an
|
|
// enum-backed column — the registry is open, not closed, since
|
|
// the private cloud-modules package registers its own types.
|
|
$table->string('type')->index();
|
|
$table->nullableMorphs('subject');
|
|
$table->json('data')->nullable();
|
|
$table->timestamp('read_at')->nullable();
|
|
$table->timestamp('created_at');
|
|
|
|
$table->index(['user_id', 'read_at']);
|
|
$table->index(['user_id', 'created_at']);
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('notifications');
|
|
}
|
|
};
|