2010-04-14 115 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