донат шоп, управление магазином, яндекс метрика

This commit is contained in:
2026-07-19 19:17:29 +04:00
parent 8bf1b852f0
commit df7f98fe8b
48 changed files with 1859 additions and 18 deletions
@@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function getConnection(): ?string
{
return app()->environment('testing') ? config('database.default') : 'azerothcore_auth';
}
public function up(): void
{
Schema::connection($this->getConnection())->create('account_balances', function (Blueprint $table): void {
$table->unsignedInteger('account_id')->primary();
$table->decimal('balance', 14, 2)->default(0);
$table->timestamps();
});
Schema::connection($this->getConnection())->create('payment_invoices', function (Blueprint $table): void {
$table->id();
$table->unsignedInteger('account_id')->index();
$table->decimal('amount', 14, 2);
$table->string('mode', 20)->default('test');
$table->string('status', 20)->default('pending')->index();
$table->timestamp('paid_at')->nullable();
$table->timestamps();
});
Schema::connection($this->getConnection())->create('balance_transactions', function (Blueprint $table): void {
$table->id();
$table->unsignedInteger('account_id')->index();
$table->string('type', 20);
$table->decimal('amount', 14, 2);
$table->decimal('balance_after', 14, 2);
$table->string('reference', 191)->unique();
$table->json('metadata')->nullable();
$table->timestamp('created_at')->useCurrent();
});
}
public function down(): void
{
Schema::connection($this->getConnection())->dropIfExists('balance_transactions');
Schema::connection($this->getConnection())->dropIfExists('payment_invoices');
Schema::connection($this->getConnection())->dropIfExists('account_balances');
}
};