ここで本当に明らかな何かが欠けている場合はお詫びしますが、うまくいけば、あなたは私をユーモアを交えてくれるでしょう!
私はこれらのモデルを持っています
Employee - with id, first_name, last_name
Shift Type - with id, shift_name
Date Indices - with id, date
Locations - with id, location
Allocated shifts - with employee_id, shift_type_id, date_index_id, location_id
これで、割り当てられたシフトを表示し、場所や名前などと結合するクエリを作成できますが、日付を列、従業員を行とするテーブルを作成して、このような名簿を作成できるようになりました。
______________________________________________
|employee|date 1 |date 2 | date 3 |
|'dave' |early shift|late shift |day off |
|'martha'|day off |early shift|early shift|
等
私はかなり馬鹿げていると確信していますが、これらの「仮想」列を作成して従業員にリンクするにはどうすればよいですか?