Files
sirpremiumv2/database/migrations/2022_10_28_004206_create_recargas_table.php
T
2023-11-07 22:43:10 +00:00

56 lines
1.3 KiB
PHP
Executable File

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('recargas', function (Blueprint $table) {
$table->id();
$table -> string('payment_type_id')->nullable();
$table -> string('payment_method_id')->nullable();
$table -> string('status')->nullable();
$table -> string('monto')->nullable();
$table->unsignedBigInteger('usuario_id')->nullable();
$table->foreign('usuario_id')
->references('id')
->on('users')
->onDelete('cascade')
->onUpdate('cascade');
$table->unsignedBigInteger('saldo_id')->nullable();
$table->foreign('saldo_id')
->references('id')
->on('saldos')
->onDelete('cascade')
->onUpdate('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('recargas');
}
};