n1ru4l
09/30/2022, 10:10 AMsupertokens-core
v3.16.2
to v4.0.0
and I have a few questions around the database changes for the emailpassword_users
and thirdparty_users
table:
Why did you choose VARCHAR(256)
and VARCHAR(128)
over just TEXT
? The latter would have required no database migration and would not require a database migration in the future if the value changes again. Is it safe for me to use TEXT
instead of VARCHAR(256)
- or does supertokens-core
do some kind of database schema validation?
How did you manage to roll this out in production? In my current understanding it is not possible to apply this migration without locking the full database table and rewriting every single row. Wouldn't it been smarter (and also less "breaking") to follow this strategy:
1. Add a new columns "thirdparty_users"."third_party_user_id_new" and "emailpassword_users"."password_hash_new"
2. Run a script during outside of a migration/lock that copies the values from the old column to the new column
3. Write the super tokens code in a way that it can deal with both the old and new columns for the duration of the copy from old to new column period
Right now, for us running the migration will probably not take longer than a few seconds - however, I am concerned that in the future additional breaking database changes will make it harder for us to migrate to the latest versions.
Since you probably have much more users running on your hosted solution, I am especially curious on any insights on how you manged this (of course only if it is possible to share that information)!rp_st
09/30/2022, 10:12 AMn1ru4l
09/30/2022, 10:25 AMrp_st
09/30/2022, 10:34 AMn1ru4l
09/30/2022, 11:09 AMrp_st
09/30/2022, 11:22 AMSuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).
Powered by