TP-49039 : Schema changes to remove rca_input_links from rca table (#289)

This commit is contained in:
Vijay Joshi
2023-11-20 13:25:27 +05:30
committed by GitHub
parent 28eeac680a
commit a1d3d0dc39
3 changed files with 11 additions and 14 deletions

View File

@@ -2,7 +2,6 @@ CREATE TABLE IF NOT EXISTS rca (
id SERIAL PRIMARY KEY, id SERIAL PRIMARY KEY,
incident_id integer NOT NULL REFERENCES incident(id), incident_id integer NOT NULL REFERENCES incident(id),
rca_link text, rca_link text,
rca_input_links text[],
status text NOT NULL, status text NOT NULL,
created_at timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, created_at timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP updated_at timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP

View File

@@ -5,13 +5,12 @@ import (
) )
type RcaEntity struct { type RcaEntity struct {
ID uint `gorm:"primaryKey"` ID uint `gorm:"primaryKey"`
IncidentID uint `gorm:"index"` IncidentID uint `gorm:"index"`
RcaLink string `gorm:"type:text"` RcaLink string `gorm:"type:text"`
RcaInputLinks []string `gorm:"type:text[]"` Status string `gorm:"type:text"`
Status string `gorm:"type:text"` CreatedAt time.Time `gorm:"autoCreateTime"`
CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
} }
func (RcaEntity) TableName() string { func (RcaEntity) TableName() string {

View File

@@ -219,11 +219,10 @@ func GetMockIncident() *incident.IncidentEntity {
func getMockRCA() *rca.RcaEntity { func getMockRCA() *rca.RcaEntity {
return &rca.RcaEntity{ return &rca.RcaEntity{
ID: 1, ID: 1,
IncidentID: 1, IncidentID: 1,
RcaLink: "", RcaLink: "",
RcaInputLinks: nil, CreatedAt: time.Time{},
CreatedAt: time.Time{}, UpdatedAt: time.Time{},
UpdatedAt: time.Time{},
} }
} }