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

Status
RESOLVED IMPLEMENTED
Submitter
~sircmpwn
Assigned to
No-one
Submitted
1 year, 5 months ago
Updated
4 months ago
Labels
No labels applied.

~grayhatter 8 months 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 8 months ago

That looks about right imo.

~ihabunek 4 months ago

This is resolved.

~sircmpwn 4 months ago

REPORTED RESOLVED IMPLEMENTED