added support for inviting list collaborators
This commit is contained in:
parent
cd2c8adaa8
commit
0787b75780
21 changed files with 393 additions and 34 deletions
|
|
@ -16,7 +16,7 @@ return new class extends Migration
|
|||
$table->string('username')->unique();
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->string('password')->nullable();
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ return new class extends Migration
|
|||
$table->string('email');
|
||||
$table->string('token')->unique();
|
||||
$table->foreignId('movie_list_id')->constrained()->cascadeOnDelete();
|
||||
$table->enum('status', ['pending', 'accepted_login_pending', 'accepted', 'declined'])->default('pending');
|
||||
$table->dateTime('expires_at');
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
<?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('movie_list_user', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('movie_list_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||
$table->enum('role', ['viewer', 'editor', 'admin'])->default('viewer');
|
||||
$table->unique(['movie_list_id', 'user_id']);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('movie_list_user');
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue