Skip to content

Commit

Permalink
feat: Add migration for inventory_logs table to tr
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Mar 11, 2024
1 parent 857c21e commit bcd1d61
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateInventoryLogsTable extends Migration
{
public function up()
{
Schema::create('inventory_logs', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('product_id');
$table->integer('quantity_change');
$table->text('reason');
$table->timestamps();

$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
});
}

public function down()
{
Schema::dropIfExists('inventory_logs');
}
}

0 comments on commit bcd1d61

Please sign in to comment.