Create 2026_02_09_000002_add_proveedor_id_to_recepciones_table.php

This commit is contained in:
Lizandro Guarnizo
2026-02-09 15:18:42 -05:00
parent 9de6ba17a1
commit 4b9d7a1f25
@@ -0,0 +1,33 @@
<?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('recepciones', function (Blueprint $table) {
$table->foreignId('proveedor_id')
->nullable()
->after('user_id')
->constrained('proveedors')
->nullOnDelete();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('recepciones', function (Blueprint $table) {
$table->dropForeign(['proveedor_id']);
$table->dropColumn('proveedor_id');
});
}
};