pedi3/database/migrations/2024_03_11_210402_create_ba...

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