Compare commits
No commits in common. "e7481eac95fe25c8f60fafcfd99b6c24b35151da" and "a35b50bec62cd246a724332971a668a8077b3b95" have entirely different histories.
e7481eac95
...
a35b50bec6
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Resources\DynamicResource;
|
|
||||||
use App\Models\Dynamic;
|
use App\Models\Dynamic;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
@ -45,7 +44,7 @@ class ParticipantController extends Controller
|
|||||||
->get();
|
->get();
|
||||||
|
|
||||||
return Inertia::render('Dynamics/Participants/Show', [
|
return Inertia::render('Dynamics/Participants/Show', [
|
||||||
'dynamic' => new DynamicResource($dynamic),
|
'dynamic' => $dynamic,
|
||||||
'participant' => [
|
'participant' => [
|
||||||
'id' => $user->id,
|
'id' => $user->id,
|
||||||
'name' => $user->name,
|
'name' => $user->name,
|
||||||
|
|||||||
@ -13,11 +13,10 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('predefined_mutations', function (Blueprint $table) {
|
Schema::create('predefined_mutations', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignId('dynamic_id')->constrained()->cascadeOnDelete();
|
$table->foreignId('ledger_id')->constrained()->cascadeOnDelete();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->text('description')->nullable();
|
$table->text('description')->nullable();
|
||||||
$table->integer('amount');
|
$table->integer('amount');
|
||||||
$table->string('type')->default('reward');
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,41 +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::table('predefined_mutations', function (Blueprint $table) {
|
|
||||||
// Drop old foreign key constraint first
|
|
||||||
$table->dropForeign(['dynamic_id']);
|
|
||||||
|
|
||||||
// Drop old columns
|
|
||||||
$table->dropColumn(['dynamic_id', 'type']);
|
|
||||||
|
|
||||||
// Add new ledger relationship (nullable to support pre-existing entries gracefully)
|
|
||||||
$table->foreignId('ledger_id')
|
|
||||||
->after('id')
|
|
||||||
->nullable()
|
|
||||||
->constrained()
|
|
||||||
->cascadeOnDelete();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::table('predefined_mutations', function (Blueprint $table) {
|
|
||||||
$table->dropConstrainedForeignId('ledger_id');
|
|
||||||
$table->foreignId('dynamic_id')->after('id')->constrained()->cascadeOnDelete();
|
|
||||||
$table->string('type')->default('reward');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@ -196,7 +196,7 @@ function getAmountClass(amount: number): string {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Chat v-if="mutation.chat" :chat="mutation.chat" :dynamic-id="dynamicId" :participants="participants" />
|
<Chat :chat="mutation.chat" :dynamic-id="dynamicId" :participants="participants" />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div v-if="mutations.length === 0" class="c-mutation-list__empty">
|
<div v-if="mutations.length === 0" class="c-mutation-list__empty">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user