Closed samburgers closed 2 months ago
Hi, discovered a small but breaking issue with this schema:
const authSchema = pgSchema("auth"); export const User = authSchema.table("users", { id: uuid("id").notNull().primaryKey().defaultRandom(), email: text("email").notNull().unique(), }); export const ProfileInfo = pgTable("profile_info", { id: uuid("id").notNull().primaryKey().defaultRandom(), userId: uuid("user_id") .references(() => User.id) .notNull() .unique(), });
Which outputs this invalid dbml:
table profile_info { id uuid [pk, not null, default: `gen_random_uuid()`] user_id uuid [not null, unique] } table auth.users { id uuid [pk, not null, default: `gen_random_uuid()`] email text [not null, unique] } ref profile_info_user_id_users_id_fk: profile_info.user_id > users.id [delete: no action, update: no action]
If i go and hand change the last line to this it validates fine
ref profile_info_user_id_users_id_fk: profile_info.user_id > auth.users.id [delete: no action, update: no action]
so just users.id needs to become auth.users.id
users.id
auth.users.id
Many thanks!
Hi, discovered a small but breaking issue with this schema:
Which outputs this invalid dbml:
If i go and hand change the last line to this it validates fine
so just
users.id
needs to becomeauth.users.id
Many thanks!