Skip to content

Commit a4f326c

Browse files
authored
feat: adds support for user migration (#54)
* fixs * udpdates thirdparty table column length * updates CHANGELOG.md * fix * updates build.gradle
1 parent 0fd15aa commit a4f326c

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [2.0.0] - 2022-09-19
11+
12+
- Updates the `third_party_user_id` column in the `thirdparty_users` table from `VARCHAR(128)` to `VARCHAR(256)` to resolve https://github.com/supertokens/supertokens-core/issues/306
13+
14+
- Adds support for user migration
15+
- Updates the `password_hash` column in the `emailpassword_users` table from `VARCHAR(128)` to `VARCHAR(256)` to support more types of password hashes.
16+
17+
- For legacy users who are self hosting the SuperTokens core run the following command to update your database with the changes:
18+
`ALTER TABLE thirdparty_users ALTER COLUMN third_party_user_id TYPE VARCHAR(256); ALTER TABLE emailpassword_users ALTER COLUMN password_hash TYPE VARCHAR(256);`
19+
1020
## [1.20.0] - 2022-08-18
1121

1222
- Adds log level feature and compatibility with plugin interface 2.18

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'java-library'
33
}
44

5-
version = "1.20.0"
5+
version = "2.0.0"
66

77
repositories {
88
mavenCentral()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static String getQueryToCreateUsersTable(Start start) {
4949
+ "user_id CHAR(36) NOT NULL,"
5050
+ "email VARCHAR(256) NOT NULL CONSTRAINT " +
5151
Utils.getConstraintName(schema, emailPasswordUsersTable, "email", "key") + " UNIQUE,"
52-
+ "password_hash VARCHAR(128) NOT NULL," + "time_joined BIGINT NOT NULL,"
52+
+ "password_hash VARCHAR(256) NOT NULL," + "time_joined BIGINT NOT NULL,"
5353
+ "CONSTRAINT " + Utils.getConstraintName(schema, emailPasswordUsersTable, null, "pkey") +
5454
" PRIMARY KEY (user_id));";
5555
// @formatter:on

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static String getQueryToCreateUsersTable(Start start) {
4646
// @formatter:off
4747
return "CREATE TABLE IF NOT EXISTS " + thirdPartyUsersTable + " ("
4848
+ "third_party_id VARCHAR(28) NOT NULL,"
49-
+ "third_party_user_id VARCHAR(128) NOT NULL,"
49+
+ "third_party_user_id VARCHAR(256) NOT NULL,"
5050
+ "user_id CHAR(36) NOT NULL CONSTRAINT " +
5151
Utils.getConstraintName(schema, thirdPartyUsersTable, "user_id", "key") + " UNIQUE,"
5252
+ "email VARCHAR(256) NOT NULL,"

0 commit comments

Comments
 (0)