diff --git a/userapi/storage/accounts/postgres/accounts_table.go b/userapi/storage/accounts/postgres/accounts_table.go index d79ed0535..a74d04ad4 100644 --- a/userapi/storage/accounts/postgres/accounts_table.go +++ b/userapi/storage/accounts/postgres/accounts_table.go @@ -120,9 +120,9 @@ func (s *accountsStatements) insertAccount( var err error if appserviceID == "" { - _, err = stmt.ExecContext(ctx, localpart, createdTimeMS, hash, nil, "") + _, err = stmt.ExecContext(ctx, localpart, createdTimeMS, hash, nil, policyVersion) } else { - _, err = stmt.ExecContext(ctx, localpart, createdTimeMS, hash, appserviceID, policyVersion) + _, err = stmt.ExecContext(ctx, localpart, createdTimeMS, hash, appserviceID, "") } if err != nil { return nil, err diff --git a/userapi/storage/accounts/sqlite3/accounts_table.go b/userapi/storage/accounts/sqlite3/accounts_table.go index f1c24e220..95ebb022e 100644 --- a/userapi/storage/accounts/sqlite3/accounts_table.go +++ b/userapi/storage/accounts/sqlite3/accounts_table.go @@ -120,9 +120,9 @@ func (s *accountsStatements) insertAccount( var err error if appserviceID == "" { - _, err = sqlutil.TxStmt(txn, stmt).ExecContext(ctx, localpart, createdTimeMS, hash, nil, "") + _, err = sqlutil.TxStmt(txn, stmt).ExecContext(ctx, localpart, createdTimeMS, hash, nil, policyVersion) } else { - _, err = sqlutil.TxStmt(txn, stmt).ExecContext(ctx, localpart, createdTimeMS, hash, appserviceID, policyVersion) + _, err = sqlutil.TxStmt(txn, stmt).ExecContext(ctx, localpart, createdTimeMS, hash, appserviceID, "") } if err != nil { return nil, err