Models refactor + Basic functionnalities
This commit is contained in:
@@ -15,7 +15,7 @@ return new class extends Migration
|
||||
Schema::create('resumes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('name', 255);
|
||||
$table->string('name', 255)->nullable();
|
||||
$table->foreignIdFor(User::class, "creator_id")->constrained()->onDelete('cascade');
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
@@ -14,6 +14,7 @@ return new class extends Migration
|
||||
Schema::create('resume_components', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('name');
|
||||
$table->string('vue_component_name')->unique();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
@@ -20,7 +20,8 @@ return new class extends Migration
|
||||
$table->foreignIdFor(ResumeComponentDataType::class)->constrained()->onDelete('cascade');
|
||||
|
||||
$table->string('name');
|
||||
$table->string("placeholder");
|
||||
$table->string('label')->nullable();
|
||||
$table->string("placeholder")->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Resume;
|
||||
use App\Models\ResumeComponent;
|
||||
use App\Models\ResumeComponentData;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
@@ -13,11 +13,11 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('resume_slots', function (Blueprint $table) {
|
||||
Schema::create('resume_component_placements', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignIdFor(Resume::class)->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(ResumeComponent::class)->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(Resume::class, 'resume_id')->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(ResumeComponentData::class, 'resume_component_data_id')->constrained()->onDelete('cascade');
|
||||
|
||||
$table->integer('order')->default(0);
|
||||
|
||||
@@ -30,6 +30,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('resume_slots');
|
||||
Schema::dropIfExists('resume_component_placements');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use App\Models\ResumeComponent;
|
||||
use App\Models\ResumeComponentPlacement;
|
||||
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('resume_component_data', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignIdFor(ResumeComponent::class, 'resume_component_id')->constrained()->onDelete('cascade');
|
||||
// $table->foreignIdFor(ResumeComponentPlacement::class, 'resume_component_placement_id')->constrained()->onDelete('cascade');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('resume_component_data');
|
||||
}
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Models\ResumeComponentData;
|
||||
use App\Models\ResumeComponentInput;
|
||||
use App\Models\ResumeSlot;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
@@ -13,13 +13,13 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('resume_slot_values', function (Blueprint $table) {
|
||||
Schema::create('resume_component_input_data', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignIdFor(ResumeSlot::class, 'resume_slot_id')->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(ResumeComponentData::class, 'resume_component_data_id')->constrained()->onDelete('cascade');
|
||||
$table->foreignIdFor(ResumeComponentInput::class, 'resume_component_input_id')->constrained()->onDelete('cascade');
|
||||
|
||||
$table->string('value');
|
||||
$table->string('value')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
@@ -30,6 +30,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('resume_slot_values');
|
||||
Schema::dropIfExists('resume_component_input_data');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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('personal_access_tokens', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->morphs('tokenable');
|
||||
$table->text('name');
|
||||
$table->string('token', 64)->unique();
|
||||
$table->text('abilities')->nullable();
|
||||
$table->timestamp('last_used_at')->nullable();
|
||||
$table->timestamp('expires_at')->nullable()->index();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('personal_access_tokens');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user