Comments (3)
We can leave this up if you guys want but I'm very relieved I was able to solve this issue on my own. I needed to add the schema declaration (auth.) to the enum on creation like so:
in my migration.sql, otherwise it would appear it was attempting to add the enum to the default schema which would make sense when you look at the duplicate enum in the drift detection error screenshot above.
Note: I also had to add schema declaration (auth.) the one_time_tokens.token_type column as shown here:
otherwise you would get this error on migrate:
All in all consider this issue solved and an oversight by me (best possible outcome), hopefully it helps anyone who has to keep the auth schema in sync in response to supabase making changes. You can't just copy the migrations from this repo:
https://github.com/supabase/auth/blob/master/migrations/
change the namespace to auth and call it a day. As the changes get applied to your Supabase instances and cause prisma to detect drift, you have to carefully consider the code going in those migration.sql files and the changes you make to your schema.prisma as well.
Again, consider this issue solved. Archive it if you feel like it can help people or let me know if you want me to delete it.
Thanks.
from auth.
We strongly recommend not using Prisma or anything else to touch anything in the auth
schema. You can very easily break your Supabase Auth server, and we may not be able to help you recover data if you do so.
We are seeing quite a lot of problems caused with this, so in the mid-term it is very likely we will implement some measures that would prevent you from touching the auth
schema at all. You would be able to turn this off, at your own risk.
from auth.
For clarity, we don't "touch" the auth schema we reference the users.id outside of the auth schema which is supported per the docs for anyone using supabase auth.
I do suggest not giving up on this because it does allow for a robust and efficient development team experience. I would go as far as working with the prisma team to allow a schema like auth to be referenced but not "managed" in the same way prisma wants to strictly manage all included schemas.
If I weren't able to use prisma do you have plans to create or support a first/third party tool kit primarily as a way to manage changes in a development supabase environment (db schema's, RLS policies, functions, triggers, etc.) and deploying them to a production supabase environment?
To put it another way, If I started a new suapbase env I could have it set up in minutes thanks to the prisma schema and migrations I have in our codebase. This is the type of functionality we will be looking for.
I appreciate your feedback and look forward to your response.
from auth.
Related Issues (20)
- .well-known/jwks.json to use in REST API HOT 2
- Sharing a Supabase Auth Session - Incompatibility Between Supabase Flutter and Swift SDKs: Session JSON Structure Mismatch HOT 4
- Issue with migrations HOT 7
- HookName field unavailable in the UI, thus not saved in backend. HOT 7
- auth.signUp accepts empty email and password when anonymous sign in is enabled HOT 1
- send_email auth hook email_change does not contain token HOT 2
- auth.admin.generateLink does not return proper redirectTo HOT 4
- Auth - Error sending magic link - Status 500
- AuthException Not returning valid message and status code for banned_until As per documentation HOT 5
- In Firebase, the password hash is stored in passwordHash and is hashed using SCRYPT with specific parameters. In Supabase, the password is stored in encrypted_password and is hashed using bcrypt. As a result, when migrating authenticated users, an error occurs due to the different password hashing algorithms. HOT 5
- Captcha fails after migrating from hCaptcha to Turnstile HOT 2
- env replacement in [auth.sms.twilio] / `account_sid` HOT 1
- Some JWTs exceed Cloudflare header size limits & Nginx defaults
- Kakao Login: Need for both REST API Key and Native App Key causes confusion
- GOTRUE_JWT_SECRET value and base64 string format
- Sending a magic link will sometimes fail due to password.Generate generating an invalid password
- linkIdentity errors out if the account already exists HOT 1
- Various Ways of Password Reset
- PUT /USER is abusable HOT 1
- Too long strings in user_metadata causing authentication to break
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auth.