meobda-website/database/migrations/2025_12_16_190859_create_in...

33 lines
786 B
PHP

<?php
use Database\Seeders\InstrumentSeeder;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('instruments', function (Blueprint $table) {
$table->id();
$table->string('instrument');
$table->integer('score_order');
$table->index('score_order');
});
Artisan::call('db:seed', ['--class' => InstrumentSeeder::class]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('instruments');
}
};