Giter Club home page Giter Club logo

Comments (3)

ODreelist avatar ODreelist commented on September 23, 2024

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:

image

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:

image

otherwise you would get this error on migrate:

image

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.

hf avatar hf commented on September 23, 2024

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.

ODreelist avatar ODreelist commented on September 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.