Skip to content

Commit

Permalink
Index validator fix
Browse files Browse the repository at this point in the history
  • Loading branch information
petans24 committed Jan 31, 2024
1 parent 1ccf70d commit bbbbfb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHERE
and i.oid = ix.indexrelid
and a.attrelid = t.oid
and a.attnum = ANY(ix.indkey)
and t.relkind = 'r'
and t.relkind IN ('r','p')
and t.relname = $1
GROUP BY
t.relname,
Expand All @@ -56,6 +56,7 @@ var mandatoryIndexes = [][]string{
{"processed_at"},
}

// ValidateFields checks if required fields exist
func ValidateFields(db *sql.DB, queueName string) error {
// --- (1) ----
// Recover the columns that the queue has
Expand Down Expand Up @@ -91,7 +92,7 @@ func ValidateFields(db *sql.DB, queueName string) error {
return nil
}

// Validate if requiered indexes exist
// ValidateIndexes checks if required indexes exist
func ValidateIndexes(db *sql.DB, queueName string) error {
// --- (1) ----
// Recover the indexes that the queue has
Expand Down

0 comments on commit bbbbfb9

Please sign in to comment.