Create 2026_02_09_000002_add_proveedor_id_to_recepciones_table.php
This commit is contained in:
@@ -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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user