2010-04-14 98 views
0

我正在开发用于网络管理的自定义故障单系统,并试图找到以下情形最好的数据库表的布局最好的数据库表的布局/设计:自定义客票系统

有代表PON表, T1和T3线。每行可能有一个或多个故障单,但每个故障单都有一些独特的字段,取决于此tiket属于哪种类型的行。

这里是我的方法:

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 

我建设使用的Symfony 1.4 PHP框架与学说ORM我的应用程序。

还有其他想法吗?感谢您的任何帮助。

+0

真的吗? http://www.opensourcehelpdesklist.com/中的系统都不适合您的使用情况,您需要实现自己的?我很想知道是什么让你的情况独特! – moshez 2010-04-14 22:21:11

+0

如果我明白“pon”,“t1”,“t3”是什么,以及为什么“ticket _ * _ type”表格适合,这将更容易回答。 – 2010-04-14 22:45:44

+0

@moshez非常感谢您的链接!我一直在寻找像这个网站,但由于某种原因没有找到这个...看起来像OTRS或RT系统将符合我的需求。 – vooD 2010-04-15 08:08:47

回答

2

pon,t1t3应合并到一张表中。将一列line列添加到表中,以便您可以判断每条记录是否为pon,t1t3

我想你会发现这也可以让你巩固你的ticket_type表。

+0

'pon','t1'和't3'表必须有许多独特的列(这是传统的数据库布局),以及如果每个票据类型表都有10个唯一列,会出现什么情况? – vooD 2010-04-14 22:22:40