UNPKG

@tomei/sso

Version:
24 lines (18 loc) 1.29 kB
## SSO Package ### How to use - run `npm i` - Make sure you set the environment in .sampledotenv in your project `.env` file - run `npm run start:dev` ### How create a new migration - Make sure you have `DATABASE_URL` and `SHADOW_DATABASE_URL` in your project `.env` file - create a new empty database. dont do migration on it and set the `SHADOW_DATABASE_URL` to it - Create a database user - Grant the above user privileges to alter sso tables and shadow database. The user should have access to the sso table and shadow database only. Use `create-sso-user.sql` as an example to create the user and grant privileges - Make changes to the `schema.prisma` file - Run `npx prisma migrate dev --name <migration-name> --preview-feature --create-only` to create the migration. The migration will be created in the `migrations` folder. - open the newly created migration. review the migration and make changes if necessary. notes: - if you create a new table, after migration has been created, change the default character set to `latin1` from `utf8mb4` and remove COLLATE phrase.please also add it to the `create-sso-user.sql` file for references ### How to run migration - run `npx prisma migrate deploy` to run the migration - run `npx prisma generate` to generate the prisma client