stakwork / sphinx-tribes

Backend for sphinx tribes and bounties. The bounty platform pays out in bitcoin. Sign up with Sphinx Chat, complete a bounty, and earn bitcoin! Go to our website for available bounties.
https://community.sphinx.chat/bounties
33 stars 60 forks source link

Create new table `ticket` in Tribes DB #1971

Open humansinstitute opened 4 days ago

humansinstitute commented 4 days ago

Context

Task

  1. Create a new migration file for the ticket table
  2. Implement the table schema using GORM
  3. Add necessary indexes for performance optimization
  4. Include foreign key constraints for feature and phase references
  5. Implement the GORM model struct
  6. Add validation methods for the model
  7. Create database migration test

Outcome

A new ticket table in the Tribes database that:

Design

Database Schema Implementation

The table should be implemented using the following GORM structure:

goCopytype Ticket struct {
    UUID        string       `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()"`
    FeatureUUID string       `gorm:"type:uuid;not null;index"`
    PhaseUUID   string       `gorm:"type:uuid;not null;index"`
    Name        string       `gorm:"type:varchar(255);not null"`
    Sequence    int          `gorm:"type:integer;not null"`
    Dependency  []int        `gorm:"type:integer[]"`
    Description string       `gorm:"type:text"`
    Status      TicketStatus `gorm:"type:varchar(50);not null;default:'draft'"`
    CreatedAt   time.Time    `gorm:"type:timestamp;not null;default:current_timestamp"`
    UpdatedAt   time.Time    `gorm:"type:timestamp;not null;default:current_timestamp"`
}

Required Indexes

Acceptance Criteria

Functional Requirements

Technical Requirements

Testing Requirements

MuhammadUmer44 commented 4 days ago

@humansinstitute Please assign me

MahtabBukhari commented 4 days ago

@humansinstitute could you please assign me?

aliraza556 commented 4 days ago

@humansinstitute please assign me