Add index software (#3241)

* Add index to software over name/id

* Update schema

* Remove double semi colon
This commit is contained in:
Tomas Touceda
2021-12-07 16:36:13 -03:00
committed by GitHub
parent 8cea7f480a
commit 8686c1520b
3 changed files with 27 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
* Add index to the software table to improve the performance of the home page
@@ -0,0 +1,22 @@
package tables
import (
"database/sql"
"github.com/pkg/errors"
)
func init() {
MigrationClient.AddMigration(Up_20211207161856, Down_20211207161856)
}
func Up_20211207161856(tx *sql.Tx) error {
if _, err := tx.Exec(`create index software_listing_idx on software(name, id);`); err != nil {
return errors.Wrap(err, "creating software index")
}
return nil
}
func Down_20211207161856(tx *sql.Tx) error {
return nil
}
File diff suppressed because one or more lines are too long