Skip to content

Commit 272e1a0

Browse files
committed
fix: change user id index in user roles to smaller one
1 parent 9f68cf2 commit 272e1a0

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10-
## [8.1.1]
10+
## [8.1.2]
1111

12-
- Adds more null and empty checks for bulk migration
1312
- Adds user_id index to the user roles table
1413

1514
### Migration
1615

1716
```sql
18-
CREATE INDEX IF NOT EXISTS user_roles_app_id_tenant_id_user_id_index ON user_roles (app_id, tenant_id, user_id);
17+
CREATE INDEX IF NOT EXISTS user_roles_app_id_user_id_index ON user_roles (app_id, user_id);
1918
```
19+
20+
## [8.1.1]
21+
22+
- Adds more null and empty checks for bulk migration
23+
2024
## [8.1.0]
2125

2226
- Adds support for webauthn (passkeys)

src/main/java/io/supertokens/storage/postgresql/queries/UserRolesQueries.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ public static String getQueryToCreateUserRolesRoleIndex(Start start) {
117117
}
118118

119119
public static String getQueryToCreateUserIdIndexForUserRolesTable(Start start) {
120-
return "CREATE INDEX IF NOT EXISTS user_roles_app_id_tenant_id_user_id_index ON " + getConfig(start).getUserRolesTable() +
121-
"(app_id, tenant_id, user_id);";
120+
return "CREATE INDEX IF NOT EXISTS user_roles_app_id_user_id_index ON " + getConfig(start).getUserRolesTable() +
121+
"(app_id, user_id);";
122122
}
123123

124124
public static boolean createNewRoleOrDoNothingIfExists_Transaction(Start start, Connection con,

0 commit comments

Comments
 (0)