From 8ae2440da3a9b66c379c5a9444b50e758deef61b Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sun, 6 Apr 2025 14:39:40 +0200 Subject: [chore] Migrate accounts to new table, relax uniqueness constraint of actor `url` and collections (#3928) * [chore] Migrate accounts to new table, relax uniqueness constraint of actor url and collections * fiddle with it! (that's what she said) * remove unused cache fields * sillyness * fix tiny whoopsie --- internal/db/account.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'internal/db/account.go') diff --git a/internal/db/account.go b/internal/db/account.go index cfb81308f..0caac3453 100644 --- a/internal/db/account.go +++ b/internal/db/account.go @@ -27,37 +27,37 @@ import ( // Account contains functions related to account getting/setting/creation. type Account interface { - // GetAccountByID returns one account with the given ID, or an error if something goes wrong. + // GetAccountByID returns one account with the given ID. GetAccountByID(ctx context.Context, id string) (*gtsmodel.Account, error) // GetAccountsByIDs returns accounts corresponding to given IDs. GetAccountsByIDs(ctx context.Context, ids []string) ([]*gtsmodel.Account, error) - // GetAccountByURI returns one account with the given URI, or an error if something goes wrong. + // GetAccountByURI returns one account with the given ActivityStreams URI. GetAccountByURI(ctx context.Context, uri string) (*gtsmodel.Account, error) - // GetAccountByURL returns one account with the given URL, or an error if something goes wrong. - GetAccountByURL(ctx context.Context, uri string) (*gtsmodel.Account, error) + // GetOneAccountByURL returns *one* account with the given ActivityStreams URL. + // If more than one account has the given url, ErrMultipleEntries will be returned. + GetOneAccountByURL(ctx context.Context, url string) (*gtsmodel.Account, error) - // GetAccountByUsernameDomain returns one account with the given username and domain, or an error if something goes wrong. + // GetAccountsByURL returns accounts with the given ActivityStreams URL. + GetAccountsByURL(ctx context.Context, url string) ([]*gtsmodel.Account, error) + + // GetAccountByUsernameDomain returns one account with the given username and domain. GetAccountByUsernameDomain(ctx context.Context, username string, domain string) (*gtsmodel.Account, error) - // GetAccountByPubkeyID returns one account with the given public key URI (ID), or an error if something goes wrong. + // GetAccountByPubkeyID returns one account with the given public key URI (ID). GetAccountByPubkeyID(ctx context.Context, id string) (*gtsmodel.Account, error) - // GetAccountByInboxURI returns one account with the given inbox_uri, or an error if something goes wrong. - GetAccountByInboxURI(ctx context.Context, uri string) (*gtsmodel.Account, error) - - // GetAccountByOutboxURI returns one account with the given outbox_uri, or an error if something goes wrong. - GetAccountByOutboxURI(ctx context.Context, uri string) (*gtsmodel.Account, error) - - // GetAccountByFollowingURI returns one account with the given following_uri, or an error if something goes wrong. - GetAccountByFollowingURI(ctx context.Context, uri string) (*gtsmodel.Account, error) + // GetOneAccountByInboxURI returns one account with the given inbox_uri. + // If more than one account has the given URL, ErrMultipleEntries will be returned. + GetOneAccountByInboxURI(ctx context.Context, uri string) (*gtsmodel.Account, error) - // GetAccountByFollowersURI returns one account with the given followers_uri, or an error if something goes wrong. - GetAccountByFollowersURI(ctx context.Context, uri string) (*gtsmodel.Account, error) + // GetOneAccountByOutboxURI returns one account with the given outbox_uri. + // If more than one account has the given uri, ErrMultipleEntries will be returned. + GetOneAccountByOutboxURI(ctx context.Context, uri string) (*gtsmodel.Account, error) - // GetAccountByMovedToURI returns any accounts with given moved_to_uri set. + // GetAccountsByMovedToURI returns any accounts with given moved_to_uri set. GetAccountsByMovedToURI(ctx context.Context, uri string) ([]*gtsmodel.Account, error) // GetAccounts returns accounts -- cgit v1.2.3