I am developing a ERP for a small cooperative with special needs (that'y why they need a non-general solution).
I'd like to model the following: A "receipt" can either be incoming or outgoing For that I'd like to have three tables: collection | payment | receipt So a receipt can belong to a Collection or a Payment
I'd like to model the Receipt table with id, collection_id (fk), payment_id (fk) so there would be a 0,1:n relation from both father tables to the receipt table.
Does that make sense from a DB development view? Or is there another recommended way to model multiple inheritance?
The same question applies to a a document (image, PDF, etc.) - any uploadable resource: A document can either belong to an activity, a receipt, a project, etc.