Sep 16, 2020 12:43 AM
I have one table of bugs for Software A. Software B, with its own table of bugs, depends on software A to some small extent. Sometimes bug blockers for Software B are in the Software B table, but sometimes they’re in Software A. I need a field which can accept either. Is this possible? It seems a field can only link to records in one table, not many. But this can’t be true, can it? It’s a pretty basic function.
I am aware that the preferred way to deal with this is to contain all these entries within one table and use views to differentiate, but it really doesn’t make sense in this case. In fact, these softwares are so different that I had them in separate bases, until I realised that there was no way to access the data (prior to sync) from one base in another.
These records also have very different fields, so if I were to represent them in one table, I’d have extraneous fields for all the records.
Sep 16, 2020 05:52 AM
Sounds like you need to create a many-to-many relationship. You can learn more about that here:
Sep 16, 2020 06:28 AM
Thanks for the reply. It seems like a junction table might be the way to go–I need a table which contains all the records from two or more other tables from which to pull the record from. I am still a bit foggy on how to accomplish this, but I expect it uses a formula to fill itself with instances/copies of records from each of the source tables. Is this the right way?
Mar 22, 2023 10:47 AM
Ruby on Rails Application Development: Benefits include the ability to easily link records from different tables. In your case, you have two tables of bugs, one for Software A and one for Software B, and you need a field that can accept either. This is indeed possible with Ruby on Rails, as you can link records from multiple tables and even use views to differentiate between them. This would be much more efficient than having two separate bases and having to sync them in order to access the data. Additionally, you would not have extraneous fields for all the records as you would if you were to represent them in one table.