Update migrations
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
class CrewInvite extends Model
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
@@ -16,7 +16,7 @@ return new class extends Migration
|
|||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('email')->unique();
|
$table->string('email')->unique();
|
||||||
$table->timestamp('email_verified_at')->nullable();
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
$table->
|
$table->enum('role', ['admin', 'member'])->default('admin');
|
||||||
$table->string('password');
|
$table->string('password');
|
||||||
$table->rememberToken();
|
$table->rememberToken();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|||||||
@@ -13,9 +13,45 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('images', function (Blueprint $table) {
|
Schema::create('images', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
|
||||||
|
// Storage info
|
||||||
|
$table->string('disk')->default('s3'); // Laravel filesystem disk
|
||||||
|
$table->string('bucket')->nullable(); // optional if disk implies it
|
||||||
|
$table->string('path'); // S3 object key (unique)
|
||||||
|
|
||||||
|
// File metadata
|
||||||
|
$table->string('original_name')->nullable();
|
||||||
|
$table->string('mime_type');
|
||||||
|
$table->unsignedBigInteger('size'); // bytes
|
||||||
|
$table->unsignedInteger('width')->nullable();
|
||||||
|
$table->unsignedInteger('height')->nullable();
|
||||||
|
|
||||||
|
// Variants (thumb/web versions)
|
||||||
|
$table->json('variants')->nullable();
|
||||||
|
// example:
|
||||||
|
// {
|
||||||
|
// "thumb": "crews/1/completions/4/thumb.webp",
|
||||||
|
// "web": "crews/1/completions/4/web.webp"
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Visibility
|
||||||
|
$table->string('visibility')->default('private'); // private | public
|
||||||
|
|
||||||
|
// Security / dedupe
|
||||||
|
$table->string('checksum')->nullable(); // sha256
|
||||||
|
$table->boolean('exif_stripped')->default(true);
|
||||||
|
|
||||||
|
// Ownership
|
||||||
|
$table->foreignId('uploaded_by_user_id')
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete();
|
||||||
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->unique(['disk', 'path']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Schema::table('users', function (Blueprint $table) {
|
Schema::table('users', function (Blueprint $table) {
|
||||||
$table->foreignId('avatar_image_id')
|
$table->foreignId('avatar_image_id')
|
||||||
->nullable()
|
->nullable()
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('crews', function (Blueprint $table) {
|
Schema::create('crews', function (Blueprint $table) {
|
||||||
$table->id();
|
$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->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,10 +16,8 @@ return new class extends Migration
|
|||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('description');
|
$table->string('description');
|
||||||
$table->string('slug');
|
$table->string('slug');
|
||||||
$table->int('difficulty')->default(0);
|
$table->integer('difficulty')->default(0);
|
||||||
$table->foreignId('image_id')->nullable()->constrained()->cascadeOnDelete();
|
$table->foreignId('image_id')->nullable()->constrained()->cascadeOnDelete();
|
||||||
$table->foreignId('category_id')->nullable()->constrained()->cascadeOnDelete();
|
|
||||||
$table->string('icon')->nullable();
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('crew_patches', function (Blueprint $table) {
|
Schema::create('crew_patches', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||||
|
$table->foreignId('crew_patch_id')->constrained()->cascadeOnDelete();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
<?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('crew_invites', function (Blueprint $table) {
|
|
||||||
$table->id();
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('crew_invites');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -13,6 +13,10 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('crew_patch_completions', function (Blueprint $table) {
|
Schema::create('crew_patch_completions', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||||
|
$table->foreignId('crew_patch_id')->constrained()->cascadeOnDelete();
|
||||||
|
$table->foreignId('image_id')->constrained()->cascadeOnDelete();
|
||||||
|
$table->string('description');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('crew_patch_completion_reactions', function (Blueprint $table) {
|
Schema::create('crew_patch_completion_reactions', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
$table->foreignId('crew_patch_completion_id')->constrained()->cascadeOnDelete();
|
||||||
|
$table->string('reaction');
|
||||||
|
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,13 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('categories', function (Blueprint $table) {
|
Schema::create('categories', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
$table->string('name');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Schema::table('categories', function (Blueprint $table) {
|
||||||
|
$table->foreignId('category_id')->constrained()->cascadeOnDelete();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user