开发者

The best database table layout/design for a custom ticket system

开发者 https://www.devze.com 2022-12-26 17:05 出处:网络
I\'m developing a custom trouble ticket system for network management and trying to find the best database table layout for following scenario:

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.


pon, t1 and t3 should be consolidated into a single table. Add a line column to the table so that you can tell whether each record is a pon, t1 or t3.

I think you will find that this will also allow you to consolidate your ticket_type tables.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号