I'm developing a custom trouble ticket system for network management and trying to find the best database table layout for following scenario:
There are tables representing PON, T1 and T3 lines. Each line may have one or more trouble tickets, but every trouble ticket has some unique fields depend on what type of line this tiket belongs.
Here is my approach:
pon:
pon_id, pk
....
#here other unique pon table columns
t1:
t1_id, pk
....
#here other unique t1 table columns
t3:
t3_id, pk
....
#here other unique t3 table columns
ticket:
ticket_id, pk
type, string # t1, t3, pon
type_id, int # id of pon, t1 or t3
....
#here other columns, which are common for all ticket types
ticket_pon_type:
ticket_id, pk, fk
....
#here unique pon ticket columns
ticket_t1_type:
ticket_id, pk, fk
....
#here unique t1 ticket columns
ticket_t3_type:
ticket_id, pk, fk
....
#here unique t3 ticket columns
I'm building my application using Symfony 1.4 PHP framework with Doctrine ORM.
Any other ideas? Thank you for any help.