Tracking changes to posts

I’m currently in the process of writing a support ticket system… Let’s say it’s a small forum application, or something like Uservoice.

Now I want my users to be able to edit their tickets, but still be able to see the old versions of them.

Which route should I take in terms of Database-Design?

I’ve thought of something like:

SupportTickets

  • Identifier
  • Author
  • Subject
  • SupportTicketContentId

SupportTicketContents

  • Identifier
  • Content
  • CreatedOn

Now when viewing a ticket, I’d simply query the most recent SupportTicketContent depending on the CreatedOn column…

But is there a better way? Or is there a better naming of these tables?

6

Working from Redmine and its database design you have a ticket, a journal item, and any details associated with that.

 +--------------+     +----------------+   +----------------+
 | ticket       |     | journal        |   | journal_details|
 |--------------|     |----------------|   |----------------|
 | id           +-+   | id             +-+ | id             |
 | author       | +---+ ticket_id      | +-+ journal_id     |
 | subject      |     | author         |   | field          |
 | priority     |     | timestamp      |   | new_value      |
 | ...          |     | notes          |   | old_value      |
 |              |     |                |   |                |
 +--------------+     +----------------+   +----------------+

You don’t copy the entire issue each time, but rather you keep all of the ‘header’ and meta data information up to date in the ticket table.

Then, for updates to it (additional notes and any field changes) you create a row in the journal table. If all you did was add notes, you just add a journal entry. If, however, a field changed (like the priority) a journal entry row is added, and a journal_detail row for each row changed.

Say you have ticket #123 and you:

  • Add notes (‘this is actually bar’)
  • Change the subject from ‘foo’ to ‘bar’
  • Change the priority from ‘critical’ to ‘low’

The following things would happen:

  • Journal row is added with with the author as you, timestamp as now, ticket_id as 123, and the notes as ‘this is actually bar’. Lets say this row has an ID of 456.
  • A journal_detail row is added with jounral_id of 456, field of ‘subject’ new_value of ‘bar’, old_value of ‘foo’
  • A journal_detail row is added with journal_id of 456, field of ‘priority’ new value of ‘low’, old value of ‘critical’
  • Ticket is updated with subject of ‘bar’ and priority of ‘low’

This way, if needed, one could reconstruct the past and see who did what when. But few people want to see what it really looks like a month ago – they want fast queries and displays against current data.

Short Answer: Honestly, creating a new ticket tracking system from the scratch is tempting and cool! However, I would try stay away from re-inventing the wheel.

One of the good approaches would be clarifying all business requirements and look for available open-source alternatives. Here you are several alternatives to start with:

  • ASP.net based open source support ticket system
  • BugTracker.NET
  • Slick-ticket.com/
  • Ticket Desk

4

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật