irrationaljared
03/02/2022, 8:13 PMauth.uid() in (
> select profile."userId"
> from profile, "_profileToteam", project
> where profile.id = "_profileToteam"."A"
> and "_profileToteam"."B" = project."teamId"
> and project.id = id
> )
but I'm getting the error:
> Error adding policy: column reference "id" is ambiguous
My understanding from the documentation here:
https://supabase.com/docs/guides/auth/row-level-security
that the "id" would be the project id. Why is it "ambiguous" or is referring to something else?garyaustin
03/02/2022, 8:38 PMirrationaljared
03/02/2022, 8:40 PMirrationaljared
03/02/2022, 8:45 PMauth.uid() in (
select profile."userId"
from profile, "_profileToteam"
where profile.id = "_profileToteam"."A"
and "_profileToteam"."B" = teamId
)
where teamId is coming from the project table?
When I do that I get the errorr:
> Error adding policy: column "teamid" does not exist
Is that because all table column names need to be lowercase?Scott P
03/02/2022, 8:47 PMid
column, and it doesn't know which table you're referring to. In your first code sample, it's not obvious what the final = id
is referencing.
In general, using camelCasing in table names opens up a big can of worms, and underscore_case is generally preferable.irrationaljared
03/02/2022, 8:54 PMsilentworks
03/02/2022, 9:00 PMgaryaustin
03/02/2022, 9:07 PMsilentworks
03/02/2022, 9:20 PMid
column. You also stated that the id
in reference would be the project id, but why are you checking if project.id = project.id
?irrationaljared
03/03/2022, 2:17 AMirrationaljared
03/03/2022, 2:17 AM