Replies: 25 comments 102 replies
This comment has been hidden.
This comment has been hidden.
-
If I have a migration file that does one of these now-prohibited things, and a subsequent migration that remediates this by moving the prohibited object to another schema, how will this interact with It seems like I'd have to go back and edit the old migrations, and then run a on-off manual script to apply the above |
Beta Was this translation helpful? Give feedback.
-
@soedirgo Perfect, I get no results now. (By the way, if you hide a comment, I can't reply to it.) |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
I'm trying the remediations on a local dev server (to prepare a script to run on production) with the Supabase CLI v2.20.12. It is not letting me. I really just want to delete these debugging functions from my production server. My cli is linked to my cloud instance at Postgres image 15.8.1.054. I get the same errors when running on a cloud hosted instance.
The functions are already invisible to me for EDIT: I also tried locally using the How do I drop or move these functions? I'm at a loss as to what is preventing it. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to apply these restrictions earlier? We would want to test it on our test database before it is applied to the production database @soedirgo Thank you! |
Beta Was this translation helpful? Give feedback.
-
@soedirgo, do you have any suggestions for how to properly handle #16067 then? This change effectively nullifies the suggested DB trigger approach on |
Beta Was this translation helpful? Give feedback.
-
This just broke my entire database! I have custom functions in the schemas like Now all of my schemas are not going to match up in my migrations files etc. Can we get some better migration tooling at least since I can't even drop the This creates so many problems! J |
Beta Was this translation helpful? Give feedback.
-
I’ve followed the instructions above: moved all my custom functions to a new schema and updated all references accordingly. Since the auth schema is now locked down, I’ve ensured none of my custom functions remain there. However, my migrations are still failing during CI (via GitHub Actions) with the following error:
Given that the migration file has already been applied and the schema permissions have since changed, what’s the recommended way to resolve this while keeping my migration history intact? |
Beta Was this translation helpful? Give feedback.
-
@soedirgo can you help me figure out what I'm not understanding? I just updated my CLI last night to use The only places in my migration files that I'm seeing an error is where I've added policies to my buckets, which, according to what you said in the original post, shouldn't be an issue, right?
Here's an example of a policy that is giving me an issue
|
Beta Was this translation helpful? Give feedback.
-
Hey do we have any info on the timeline for deletion of functions on the restricted schemas? The email/this post indicates 21 April for restricting creation, but no specific date for the statement "Otherwise, they will be deleted" Currently working to relocate & fix my migration files, but could be described as |
Beta Was this translation helpful? Give feedback.
-
did this restricting access on auth.users will complete block the trigger on auth.users to return a custom errror to api reponse ? like this issue supabase/auth#1602 |
Beta Was this translation helpful? Give feedback.
-
Folks, this is, for me, a breaking change. I have alterations in old migrations to |
Beta Was this translation helpful? Give feedback.
-
We have a concrete struggle in our development setup: We are seeding dev/test data via
From reading the above, I was assuming I could still write to The limitations are not an issue in production, but if it is intentional that we cannot insert to any auth table in dev, it would make things difficult for development and testing. |
Beta Was this translation helpful? Give feedback.
-
I thought creating RLS policies on
The referenced migration is exactly:
What should I do now? How can I create RLS for storage then? |
Beta Was this translation helpful? Give feedback.
-
With access to creating indexes gone on |
Beta Was this translation helpful? Give feedback.
-
@soedirgo, does this change also prevent us from changing permissions on On We are on |
Beta Was this translation helpful? Give feedback.
-
I think this change might have led to the following situation I'm in:
It seems that I have no way to remove the trigger and consequently I am currently triggering 1000s of edge function invocations |
Beta Was this translation helpful? Give feedback.
-
For unknown reason we have all system auth tables returned by above query. I have feeling that if I move them our production DB will die.
|
Beta Was this translation helpful? Give feedback.
-
Running this query results with these items. I never created them, When I created DB in supabase it was part of it. What does it mean now? What should I do? will the login and authorization stop working now?
|
Beta Was this translation helpful? Give feedback.
-
@soedirgo I retrieved the function SET search_path = '';
SELECT pg_catalog.format('%s(%s)', oid::regproc, pg_get_function_identity_arguments(oid::regproc)) AS function_name
FROM pg_proc
WHERE
(pronamespace = 'auth'::regnamespace AND proowner != 'supabase_auth_admin'::regrole)
OR (pronamespace = 'storage'::regnamespace AND proowner != 'supabase_storage_admin'::regrole)
OR (
pronamespace = 'realtime'::regnamespace
AND proowner NOT IN (
SELECT oid
FROM pg_roles
WHERE rolname IN ('supabase_admin', 'supabase_realtime_admin')
)
); Following the documentation, I attempted to update its schema, but after running the operation: ALTER FUNCTION auth.user_id() SET SCHEMA public; the function |
Beta Was this translation helpful? Give feedback.
-
I received an email warning me of the changes a few days ago, and telling me the restrictions will be applied on the 28th of July. We're a small operation of a few people with much more on our hands than we can chew already; I'm the only one in our team with enough domain knowledge to do the transition properly (we have multiple processes depending on functions in I had planned to take a 3 day vacation in the next few weeks (we do not have days off as we're trying to get our operation to a stable place). We're also planning an update which has been locked for months, which we will now need to rush to make space for this. This throws a significant wrench in our daily operations, as we're going to have to form a migration strategy, create tests, do a number of functional changes, and then perform the migration in production. For breaking changes like these, the grace period should be one to three years, not one month. I'm usually very satisfied with Supabase and tend to recommend it wherever I go, but this is the kind of thing that triggers immediate alarms; I suddenly don't feel like my operation is safe anymore. Is there any possibility of getting at least 3 additional months, so we have time to prepare properly? [ edit: I am aware through this thread that these changes were announced in April, but I wasn't told -- I don't read the changelog or follow the issues unless I have time -- and it still wouldn't have been enough time ] |
Beta Was this translation helpful? Give feedback.
-
If we can't create custom functions inside of the auth schema anymore, this is breaking tutorials like this auth0 one: https://supabase.com/partners/integrations/auth0 I'm not sure how to proceed |
Beta Was this translation helpful? Give feedback.
-
If we are not supposed to include the storage schema in our migration files, how will diffing include the policies on the buckets? |
Beta Was this translation helpful? Give feedback.
-
I am getting permission denied error on app_auth (I think this was created automatically by copying the functions in the auth schema) schema. Even after giving all the privilages, I still get the permission denied error on app_auth schema. Why that's happening? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
On April 21, we are restricting certain SQL actions you can perform in your database’s
auth
,storage
, andrealtime
schemas.Why are we making these restrictions?
Supabase Auth, Storage, and Realtime services each rely on their respective schemas in order to function properly.
These restrictions prevent unintended side effects like third-party tooling and user defined changes altering schemas or their objects, such as migration tables and database functions, that could disrupt or break functionality.
What this means for your project
On April 21, you will no longer be able to perform the following actions on the
auth
,storage
, andrealtime
schemas:INSERT
,UPDATE
,DELETE
,TRUNCATE
) on the following migration tables:auth.schema_migrations
storage.migrations
realtime.schema_migrations
anon
)However, you will still have permissions to perform the following actions:
auth
,storage
, andrealtime
schemasauth.audit_log_entries
auth.identities
auth.refresh_tokens
auth.sessions
auth.users
storage.buckets
storage.migrations
storage.objects
storage.s3_multipart_uploads
storage.s3_multipart_uploads_parts
realtime.messages
How to determine if you’re affected?
auth
,storage
, andrealtime
schemas:auth
,storage
, andrealtime
schemas:What you need to do
If any of the above queries return a result, you must move them to either the
public
schema or a schema that you’ve created. Otherwise, they will be deleted.Additionally, if you're using Migrations or Branching, you'll need to patch your migrations to move these objects to your own schemas. E.g. if you have a migration
20250101000000_add_custom_table.sql
like so:Then you need to edit it locally into:
Then you'll need to repair the migration history on the linked project:
Beta Was this translation helpful? Give feedback.
All reactions