pedi3/database/migrations/2024_03_11_221942_create_pe...

31 lines
700 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('pedidos', function (Blueprint $table) {
$table->id();
$table->string('name', 100);
$table->unsignedBigInteger('barrio_id');
$table->timestamps();
$table->foreign('barrio_id')->references('id')->on('barrios');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('pedidos');
}
};