Ale Gallo
b91cf0cbde
committing part of the laravel system with templating files and api implementation.
38 lines
1 KiB
PHP
38 lines
1 KiB
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('routes', function (Blueprint $table) {
|
|
$table->id();
|
|
|
|
$table->string('name_it');
|
|
$table->string('name_en');
|
|
$table->text('description_it')->nullable();
|
|
$table->text('description_en')->nullable();
|
|
// sport type defined in pivot table
|
|
// pics defined in pivot table - first pic is the cover
|
|
$table->unsignedBigInteger('route_category_id');
|
|
$table->foreign('route_category_id')->references('id')->on('categories')->onDelete('cascade');
|
|
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('routes');
|
|
}
|
|
};
|