~sircmpwn/todo.sr.ht/#18: Add ticket labels

Status
REPORTED
Submitter
~sircmpwn
Submitted
10 months ago
Updated
a month ago
User Agent
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.9.1 Chrome/56.0.2924.122 Safari/537.36

~grayhatter a month ago

something like?

``` class TicketLabel(Base): tablename = 'ticket_label' id = sa.Column(sa.Integer, primary_key=True) created = sa.Column(sa.DateTime, nullable=False) updated = sa.Column(sa.DateTime, nullable=False)

label_id = sa.Column(sa.Integer, sa.ForeignKey('label.id'))
tracker_id = sa.Column(sa.Integer, sa.ForeignKey('tracker.id'))
ticket_id = sa.Column(sa.Integer, sa.ForeignKey('ticket.id'))

user_id = sa.Column(sa.Integer, sa.ForeignKey('user.id'))

__table_args__ = (sa.UniqueConstraint('label_id', 'ticket_id', name='_label_ticket_uc'),)

class Label(Base): tablename = 'label' id = sa.Column(sa.Integer, primary_key=True) created = sa.Column(sa.DateTime, nullable=False) updated = sa.Column(sa.DateTime, nullable=False)

tracker_id = sa.Column(sa.Integer, sa.ForeignKey('tracker.id'), primary_key=True) name = sa.Column(sa.Text) color = sa.Column(sa.Text)

```

or are there other things you want to include as well?

~sircmpwn a month ago

That looks about right imo.