repuve-backend-v1/database/migrations/2025_12_04_094213_create_boxes_table.php

32 lines
748 B
PHP

<?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::create('boxes', function (Blueprint $table) {
$table->id();
$table->string('box_number');
$table->foreignId('package_id')->constrained('packages')->cascadeOnDelete();
$table->integer('starting_page');
$table->integer('ending_page');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('boxes');
}
};