-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add migration for inventory_logs table to tr
- Loading branch information
1 parent
857c21e
commit bcd1d61
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
database/migrations/2023_10_01_000000_create_inventory_logs_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
} |