Add group creation and show current groups
This commit is contained in:
@@ -3,28 +3,38 @@
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('crews', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('name');
|
||||
$table->string('description');
|
||||
$table->string('slug');
|
||||
$table->foreignId('image_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('cover_image_id')->constrained('images')->cascadeOnDelete();
|
||||
$table->text('description')->nullable();
|
||||
|
||||
// invite code
|
||||
$table->string('slug')->unique();
|
||||
|
||||
// avatar image
|
||||
$table->foreignId('image_id')
|
||||
->nullable()
|
||||
->constrained('images')
|
||||
->nullOnDelete();
|
||||
|
||||
// optional cover image
|
||||
$table->foreignId('cover_image_id')
|
||||
->nullable()
|
||||
->constrained('images')
|
||||
->nullOnDelete();
|
||||
|
||||
$table->string('avatar_icon')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('crews');
|
||||
|
||||
@@ -11,7 +11,7 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('crew_members', function (Blueprint $table) {
|
||||
Schema::create('crew_user', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained();
|
||||
$table->foreignId('crew_id')->constrained();
|
||||
@@ -26,6 +26,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('crew_members');
|
||||
Schema::dropIfExists('crew_user');
|
||||
}
|
||||
};
|
||||
@@ -13,7 +13,7 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('crew_patches', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('crew_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('crew_patch_id')->constrained()->cascadeOnDelete();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user