Add index software (#3241)
* Add index to software over name/id * Update schema * Remove double semi colon
This commit is contained in:
@@ -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
Reference in New Issue
Block a user