开发者

create github like "label" feature

I have noticed on github they allow you to create multiple labels and associate that with an issue, if you want to filter you can filter by label.

How would I go about creating something like this?

I have a task manager, what would I need to store in the database for th开发者_JAVA百科e labels?

My process (thinkin out aloud): Create a task, allow user who created the task to add a label, this label has to be from a predifined list, so a table called UserLabels - where I can store the labels, I will show the labels from this list when a user wants to add multiple labels to their task.

Do I store the the label ids inside a nvarchar(max) field as an array i.e: {labelid:5,labelid:6,labelid:900}

What is the best way to do this?


If you're wanting to do this the propper way you'd have a table that maps task ID's to Label ID's. as foreign keys.

This would be the correctly normalised way to do it.

Personally I'd have a field in my task table that contained either a list of label ids or the labels themselves. It would depend on my criteria really.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜