WIP: SoftDelete Contract/Payment/Customer, collected_by, Notifications, ProjectReport, ExportDebtReport

This commit is contained in:
2026-04-29 04:46:58 +00:00
parent 0712046f4b
commit 78c22690eb
18 changed files with 1015 additions and 12 deletions

View File

@@ -0,0 +1,25 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('notifications');
}
};

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('contracts', function (Blueprint $table) {
$table->softDeletes();
});
Schema::table('payments', function (Blueprint $table) {
$table->softDeletes();
});
Schema::table('customers', function (Blueprint $table) {
$table->softDeletes();
});
}
public function down(): void
{
Schema::table('contracts', function (Blueprint $table) {
$table->dropSoftDeletes();
});
Schema::table('payments', function (Blueprint $table) {
$table->dropSoftDeletes();
});
Schema::table('customers', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
};

View File

@@ -0,0 +1,23 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('payments', function (Blueprint $table) {
$table->foreignId('collected_by')->nullable()->constrained('users')->nullOnDelete();
});
}
public function down(): void
{
Schema::table('payments', function (Blueprint $table) {
$table->dropForeign(['collected_by']);
$table->dropColumn('collected_by');
});
}
};