team members and invitations
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('project_invitations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignUlid('project_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('invited_by')->constrained('users')->cascadeOnDelete();
|
||||
$table->string('email');
|
||||
$table->string('role')->default('member'); // member, admin, owner
|
||||
$table->string('token')->unique();
|
||||
$table->timestamp('accepted_at')->nullable();
|
||||
$table->timestamp('expires_at');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['email', 'project_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('project_invitations');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user