isau
Deity
- Joined
- Jan 15, 2007
- Messages
- 3,071
It's been a while since I worked on my mod and I've totally blanked on this. I've forgotten the chain through which Agendas connect to Leaders. There is some code in this post for hopeful added clarity, but I don't necessarily need code advice, just to know the correct tables to join.
This code produces a linkage from Agendas to the Trait level, using Agendas >> AgendaTraits >> Traits.
select * from agendas
left join agendatraits on agendas.AgendaType = agendatraits.AgendaType
left join traits on traits.TraitType = agendatraits.TraitType
I would assume adding a left join to LeaderTraits would fix show which leader the Trait is attached to:
select * from agendas
left join agendatraits on agendas.AgendaType = agendatraits.AgendaType
left join traits on traits.TraitType = agendatraits.TraitType
left join leadertraits on leadertraits.TraitType = traits.TraitType
...but it returns nothing because there are no matches. What the is actual correct linkage from Agendas to Leaders?
This code produces a linkage from Agendas to the Trait level, using Agendas >> AgendaTraits >> Traits.
select * from agendas
left join agendatraits on agendas.AgendaType = agendatraits.AgendaType
left join traits on traits.TraitType = agendatraits.TraitType
Spoiler :
I would assume adding a left join to LeaderTraits would fix show which leader the Trait is attached to:
select * from agendas
left join agendatraits on agendas.AgendaType = agendatraits.AgendaType
left join traits on traits.TraitType = agendatraits.TraitType
left join leadertraits on leadertraits.TraitType = traits.TraitType
...but it returns nothing because there are no matches. What the is actual correct linkage from Agendas to Leaders?