DropAllCollections drops all known collections from Typesense.
(ctx context.Context)
| 406 | |
| 407 | // DropAllCollections drops all known collections from Typesense. |
| 408 | func (t *TypesenseClient) DropAllCollections(ctx context.Context) error { |
| 409 | collections := []string{ |
| 410 | CollectionLedgers, |
| 411 | CollectionIdentities, |
| 412 | CollectionBalances, |
| 413 | CollectionTransactions, |
| 414 | CollectionReconciliations, |
| 415 | } |
| 416 | |
| 417 | for _, c := range collections { |
| 418 | logrus.WithField("collection", c).Debug("Dropping collection") |
| 419 | if err := t.DropCollection(ctx, c); err != nil { |
| 420 | return err |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | return nil |
| 425 | } |
| 426 | |
| 427 | func dbHasData(ctx context.Context, ds database.IDataSource) bool { |
| 428 | ledgers, err := ds.GetAllLedgers(2, 0) |
no test coverage detected