diff --git a/app/Models/AuditionEtude.php b/app/Models/AuditionEtude.php new file mode 100644 index 0000000..2c2eb61 --- /dev/null +++ b/app/Models/AuditionEtude.php @@ -0,0 +1,23 @@ +belongsTo(Instrument::class); + } + + public function auditionedEnsemble(): BelongsTo + { + return $this->belongsTo(AuditionedEnsemble::class); + } +} diff --git a/app/Models/AuditionedEnsemble.php b/app/Models/AuditionedEnsemble.php index 98cb1b3..7a8d036 100644 --- a/app/Models/AuditionedEnsemble.php +++ b/app/Models/AuditionedEnsemble.php @@ -6,5 +6,7 @@ use Illuminate\Database\Eloquent\Model; class AuditionedEnsemble extends Model { - // + protected $fillable = [ + 'name', 'set_count', + ]; } diff --git a/app/Models/Instrument.php b/app/Models/Instrument.php index 443e84a..48a9cb1 100644 --- a/app/Models/Instrument.php +++ b/app/Models/Instrument.php @@ -6,5 +6,7 @@ use Illuminate\Database\Eloquent\Model; class Instrument extends Model { - // + protected $fillable = [ + 'instrument', 'score_order', + ]; } diff --git a/database/migrations/2025_12_17_033318_create_audition_etudes_table.php b/database/migrations/2025_12_17_033318_create_audition_etudes_table.php new file mode 100644 index 0000000..5574c5a --- /dev/null +++ b/database/migrations/2025_12_17_033318_create_audition_etudes_table.php @@ -0,0 +1,35 @@ +id(); + $table->foreignIdFor(Instrument::class)->constrained()->cascadeOnDelete(); + $table->foreignIdFor(AuditionedEnsemble::class)->constrained()->cascadeOnDelete(); + $table->integer('set'); + $table->string('file_path'); + $table->string('original_filename')->nullable(); + $table->unsignedBigInteger('file_size')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('audition_etudes'); + } +};