Hi. I have a question regarding the mysql database setup. According to the documentation [1], creati...
m
Hi. I have a question regarding the mysql database setup. According to the documentation [1], creating tables "happens automatically, unless you provide a MySQL user that doesn't have table creation permission". - Is it advised to give the mysql user table creation permissions? - How does SuperTokens deal with database migrations? E.g. if a new version of supertokens-core requires a new table, how will this table be added? Is this done automatically? If so, what if the MySQL user doesn't have table creation permission? [1]: https://supertokens.com/docs/session/quick-setup/database-setup/mysql
Also: what charset and collation should be used when creating the supertokens mysql database. E.g.
charset=utf8mb4
and
collation=utf8mb4_0900_ai_ci
r
1. Yup, it makes it easier if the user has access to create tables 2. We have migration scripts in the changelog which you need to run. The new core does not run migration scripts. However, if does attempt to create new tables, which will fail if the user doesn't have permission to create tables. In this case, you should manually create the tables based on the changlog.md content in the supertokens-core github repo
m
Can you clarify this > The new core does not run migration scripts. However, if does attempt to create new tables Does this mean that the supertokens-core will only attempt to create new tables; any other changes to the database (e.g. adding a new column) would need to be done manually based on the changelog?
r
yes
m
ok
r
we will be working on auto migration soon though. But until then, this is how it is
m
ok
> what charset and collation should be used when creating the supertokens mysql database. E.g. charset=utf8mb4 and collation=utf8mb4_0900_ai_ci what about this?
r
utf8mb4 should be fine.
m
great! Thanks for the help!
7 Views