-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package migrations | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/go-gormigrate/gormigrate/v2" | ||
"gorm.io/gorm" | ||
) | ||
|
||
// Create a composite index to improve performance of summing payments in the current budget period | ||
var _202401092201_add_events_id_index = &gormigrate.Migration { | ||
ID: "202401092201_add_events_id_index", | ||
Migrate: func(tx *gorm.DB) error { | ||
|
||
var sql string | ||
sql = "CREATE INDEX idx_nostr_events_app_id_and_id ON nostr_events(app_id, id)"; | ||
|
||
return tx.Exec(sql).Error | ||
}, | ||
Rollback: func(tx *gorm.DB) error { | ||
return nil; | ||
}, | ||
} | ||
|
||
; | ||
Check failure on line 25 in migrations/202401092201_add_events_id_index.go GitHub Actions / build
|