I have a table called events where all the new information goes. This table acts as a link for all queries for news feeds, so the elements of the event are selected from there, and the information corresponding to this event is extracted from the correct tables.
Now, here is my problem. I have an E_ID in the event table that matches the event ID in another table, be it T_ID for tracks , S_ID for status , etc. These identifiers may be the same, so for now I just used a different auto_increment value for each table, so status started at 500 tracks at 0, etc. Obviously, I donβt want to do this, because I still donβt know from which table getting more data from it. I would suggest that status will quickly exceed tracks .
Information is inserted into the event table with triggers. Here is an example of one;
BEGIN INSERT INTO events (action, E_ID, ID) VALUES ('has some news.', NEW.S_ID, NEW.ID); END
This is for the status table.
Is there any addition to this trigger that I can do to provide NEW.S_ID ! = An E_ID currently in events , and if it really changes S_ID .
Alternatively, there is some kind of key that I can use to refer to events when S_ID automatically incremented S_ID that S_ID does not increase to E_ID .
These are my thoughts, I think the last solution would be better, but I doubt that it is possible or it is, but it will require another look-up table and will be too complicated.
Jacob Windsor
source share