pastvne
Bruce Decker
Hi All:
I have a primary list
I populate it with a public data source ( a CSV list of airports)
Details about the airports change over time so we need to be able to clear the primary table and re-load it periodically.
I'm allowing the standard 'id' column produced by fabrik with auto-increment but the real reference is another column called loc_id which contains the airport code (e.g., APA)
Joined table
I created a second list to store additional data not provided in the public data source
I also allow Fabrik to create its own id column, auto increment
I store a loc_id in this table as well (e.g., APA)
I INNER join the second table to the primary table from primary.loc_id to secondary.loc_id
This seems to work and the elements display properly.
However, in the primary list display, records display ONLY if there is a corresponding record in the joined table.
I am joining based on loc_id because when we re-load the primary table, there could be new airports or some could be deleted and this would change the id in the primary table. So I need a value for joining that will not change when airports are re-loaded (so that the second list data persists and reconnects with the appropriate parent record).
My Questions:
Is there a better way to model this?
Do I need to use the implicit 'id' column generated by fabrik as my primary key for the primary table or can I use the loc_id as my primary key? If so, do I need to make this change at the database level? How do I ensure that I don't break fabrik?
I have a primary list
I populate it with a public data source ( a CSV list of airports)
Details about the airports change over time so we need to be able to clear the primary table and re-load it periodically.
I'm allowing the standard 'id' column produced by fabrik with auto-increment but the real reference is another column called loc_id which contains the airport code (e.g., APA)
Joined table
I created a second list to store additional data not provided in the public data source
I also allow Fabrik to create its own id column, auto increment
I store a loc_id in this table as well (e.g., APA)
I INNER join the second table to the primary table from primary.loc_id to secondary.loc_id
This seems to work and the elements display properly.
However, in the primary list display, records display ONLY if there is a corresponding record in the joined table.
I am joining based on loc_id because when we re-load the primary table, there could be new airports or some could be deleted and this would change the id in the primary table. So I need a value for joining that will not change when airports are re-loaded (so that the second list data persists and reconnects with the appropriate parent record).
My Questions:
Is there a better way to model this?
Do I need to use the implicit 'id' column generated by fabrik as my primary key for the primary table or can I use the loc_id as my primary key? If so, do I need to make this change at the database level? How do I ensure that I don't break fabrik?