From d04996b87bfe5778c28afe6413ed178e80a29b68 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Tue, 16 Dec 2025 15:09:04 -0600 Subject: [PATCH] Create instruments model in preparation for audition etudes. --- app/Models/Instrument.php | 10 +++++ ..._12_16_190859_create_instruments_table.php | 32 ++++++++++++++ database/seeders/InstrumentSeeder.php | 43 +++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 app/Models/Instrument.php create mode 100644 database/migrations/2025_12_16_190859_create_instruments_table.php create mode 100644 database/seeders/InstrumentSeeder.php diff --git a/app/Models/Instrument.php b/app/Models/Instrument.php new file mode 100644 index 0000000..443e84a --- /dev/null +++ b/app/Models/Instrument.php @@ -0,0 +1,10 @@ +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'); + } +}; diff --git a/database/seeders/InstrumentSeeder.php b/database/seeders/InstrumentSeeder.php new file mode 100644 index 0000000..bdde4c7 --- /dev/null +++ b/database/seeders/InstrumentSeeder.php @@ -0,0 +1,43 @@ + 'Piccolo', 'score_order' => 10], + ['instrument' => 'Flute', 'score_order' => 20], + ['instrument' => 'Oboe', 'score_order' => 30], + ['instrument' => 'Bassoon', 'score_order' => 40], + ['instrument' => 'Eb Clarinet', 'score_order' => 50], + ['instrument' => 'Bb Clarinet', 'score_order' => 60], + ['instrument' => 'Bb Bass Clarinet', 'score_order' => 70], + ['instrument' => 'Eb Contrabass Clarinet', 'score_order' => 80], + ['instrument' => 'Bb Contrabass Clarinet', 'score_order' => 90], + ['instrument' => 'Eb Alto Saxophone', 'score_order' => 100], + ['instrument' => 'Bb Tenor Saxophone', 'score_order' => 110], + ['instrument' => 'Eb Baritone Saxophone', 'score_order' => 120], + ['instrument' => 'Bb Trumpet', 'score_order' => 130], + ['instrument' => 'French Horn', 'score_order' => 140], + ['instrument' => 'Trombone', 'score_order' => 150], + ['instrument' => 'Euphonium BC', 'score_order' => 160], + ['instrument' => 'Euphonium TC', 'score_order' => 170], + ['instrument' => 'Tuba', 'score_order' => 180], + ['instrument' => 'Percussion', 'score_order' => 200], + ['instrument' => 'String Bass', 'score_order' => 300], + ]; + Instrument::insert($defaultInstruments); + + // + } +}