Raw sql in schema
Hello! I'm trying to reference the supabase auth table as mentioned in the supabase docs (https://supabase.com/docs/guides/auth/managing-user-data):
Here's what I have:
But I guess I'm not doing it correctly as Ts complains:
I'm aware there are other "solutions" to this problem of referencing the auth table that involve editing the generated SQL afterwards, but would prefer if I could somehow define the raw sql in the schema itself
Thanks in advance
2 Replies
why not make table how it should be
id: uuid('id').notNull().references(() => auth.users, { onDelete: 'cascade'})
if you pass raw sql string it kind of defeats purpose of having drizzle in the first placehow do i get a reference to
auth
though?
this looks like one solution https://twitter.com/rphlmr/status/1740692744992092438, but the idea of using raw sql was to avoid having to edit the generated SQL afterwards