card action

This commit is contained in:
2025-01-26 14:42:47 +03:00
parent 08cdf44b67
commit 824130df26
27 changed files with 430 additions and 53 deletions

View File

@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public string $migration;
/**
* Run the migrations.
*/
public function up(): void
{
\kernel\App::$db->schema->table('card', function(Blueprint $table) {
$table->renameColumn('program', 'card_program_id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
\kernel\App::$db->schema->table('card', function(Blueprint $table) {
$table->renameColumn('card_program_id', 'program');
});
}
};

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public string $migration;
/**
* Run the migrations.
*/
public function up(): void
{
\kernel\App::$db->schema->table('card_transaction', function(Blueprint $table) {
$table->integer("from_balance")->after("from")->default(0);
$table->integer("to_balance")->after("to")->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
\kernel\App::$db->schema->table('card_transaction', function(Blueprint $table) {
$table->dropColumn("from_balance");
$table->dropColumn("to_balance");
});
}
};