Jaxwn
Jaxwn
Explore posts from servers
DTDrizzle Team
Created by Jaxwn on 8/27/2023 in #help
Reference to auth.users?
i was following ben davis video about sveltekit + supabase/drizzle. in his video he mention that he want to use sql file in supabase/migrations as a source of truth and then rewrote it in schema.ts,
create table profile (
id serial primary key,
first_name varchar(100),
last_name varchar(100),
email varchar(100),
user_id uuid references auth.users
);
create table profile (
id serial primary key,
first_name varchar(100),
last_name varchar(100),
email varchar(100),
user_id uuid references auth.users
);
but i prefer to use schema.ts as a source of truth then use the drizzle migrations.
export const profileTable = pgTable('profile', {
id: serial('id').primaryKey(),
last_name: varchar('last_name', { length: 100 }),
first_name: varchar('first_name', { length: 100 }),
email: varchar('email', { length: 100 }),
user_id: uuid('user_id').notNull().references(() => auth.users),
});
export const profileTable = pgTable('profile', {
id: serial('id').primaryKey(),
last_name: varchar('last_name', { length: 100 }),
first_name: varchar('first_name', { length: 100 }),
email: varchar('email', { length: 100 }),
user_id: uuid('user_id').notNull().references(() => auth.users),
});
the problem is that i can't reference the auth.users like in the .sql file
7 replies
DTDrizzle Team
Created by Jaxwn on 8/20/2023 in #help
Is there something wrong with my schema?
No description
23 replies