fac-14 / Brickworks-Tollington_Project

MIT License
2 stars 5 forks source link

Octopus database dummy #38

Closed MissArray closed 6 years ago

MissArray commented 6 years ago

The problem:

How to assign two topics to an event without displaying the same event multiple times.

One approach:

I created a second topics-table and renamed the original topics table into _maintopics. The new table is named _secondarytopics and has a column (col. 1) where the default value is a zero-length string.

Rationale:

Every event that only relates to a single topic will be matched with the corresponding description from the _maintopics table and with white space from the _secondarytopics table that can be trimmed. By contrast, an event that relates to two topics will be matched with the most relevant topic from the _maintopics and with the second most relevant topic from the _secondarytopics table. The assumption is that every event will have at least one but no more than two topics tags.

Examples:

In the screenshot, event 2 is a workshop about training young people and is thus related to both the 'youth' (table 'main', col. 3) and 'employability' (table 'secondary', col. 6) topic categories.

Question to Sangita:

For the _maintopics table I followed the structure of the topics table we did in our previous project. Is it necessary to include two columns with practically identical values? Currently, the secondary_topics table only has an id column and a description column. Also, do you think this approach will allow us to solve the problem of multiple instances of the same event being displayed? Is there a better approach you can think of?

octopus-dummy-tables