create new column for database and improve the controller

This commit is contained in:
2025-04-14 15:40:10 +03:30
parent a3600c68fa
commit 2e0b49df45
3 changed files with 87 additions and 34 deletions

View File

@@ -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
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('rahdari_point_histories', function (Blueprint $table) {
$table->after('user_id', function (Blueprint $table) {
$table->unsignedSmallInteger('previous_province_id')->nullable();
$table->string('previous_province_name')->nullable();
$table->unsignedSmallInteger('previous_city_id')->nullable();
$table->string('previous_city_name')->nullable();
$table->string('previous_name')->nullable();
});
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('rahdari_point_histories', function (Blueprint $table) {
$table->dropColumn([
'previous_province_id',
'previous_province_name',
'previous_city_id',
'previous_city_name',
'previous_name',
]);
});
}
};