fix(tahesab): show missing docs and create local table if absent
Pending list was empty because a missing tahesab table hid unsynced orders and charges. Create the table when needed and keep customer on each row. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?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
|
||||
{
|
||||
if (Schema::hasTable('tahesab')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::create('tahesab', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('customer_id')->nullable()->index();
|
||||
$table->unsignedBigInteger('order_id')->nullable()->index();
|
||||
$table->unsignedBigInteger('withdraw_id')->nullable()->index();
|
||||
$table->decimal('amount', 18, 4)->nullable();
|
||||
$table->string('desc')->nullable();
|
||||
$table->string('type', 32)->nullable();
|
||||
$table->timestamp('date')->nullable();
|
||||
$table->string('tahesab_id')->nullable()->index();
|
||||
$table->string('sh_factor')->nullable();
|
||||
$table->string('factor_number')->nullable();
|
||||
$table->string('tah_id')->nullable();
|
||||
$table->longText('data')->nullable();
|
||||
$table->longText('res')->nullable();
|
||||
$table->string('sync_status', 20)->default('pending');
|
||||
$table->text('sync_log')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
// جدول ممکن است از قبل روی نصبهای قدیمی بوده باشد؛ drop نمیکنیم.
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user