* migrateTypeSenseSchema ensures that the necessary TypeSense schema is migrated for all required collections. It takes a TypesenseClient and a context as parameters. This function loops through the predefined collections and migrates their schema in TypeSense. */
(ctx context.Context, t *search.TypesenseClient)
| 93 | This function loops through the predefined collections and migrates their schema in TypeSense. |
| 94 | */ |
| 95 | func migrateTypeSenseSchema(ctx context.Context, t *search.TypesenseClient) error { |
| 96 | // Define the collections to migrate schema for |
| 97 | collections := []string{"ledgers", "balances", "transactions", "identities", "reconciliations"} |
| 98 | |
| 99 | // Migrate schema for each collection |
| 100 | for _, c := range collections { |
| 101 | err := t.MigrateTypeSenseSchema(ctx, c) |
| 102 | if err != nil { |
| 103 | return err // Return if an error occurs during migration |
| 104 | } |
| 105 | } |
| 106 | return nil |
| 107 | } |
| 108 | |
| 109 | func getOrCreateHeartbeatID() string { |
| 110 | db, err := sql.Open("sqlite3", "./heartbeat.db") |
no test coverage detected