Typesafe references?

Why does this not show any kind of error?
export const a = pgTable('a', {
id: uuid("id").primaryKey().defaultRandom()
});
export const b = pgTable('b', {
id: uuid("id").primaryKey().defaultRandom(),
aId: timestamp('a_id').references(() => a.id).notNull()
});
export const a = pgTable('a', {
id: uuid("id").primaryKey().defaultRandom()
});
export const b = pgTable('b', {
id: uuid("id").primaryKey().defaultRandom(),
aId: timestamp('a_id').references(() => a.id).notNull()
});
A timestamp referencing a UUID should not be possible... How do I get this to be typesafe, so references checks the field that is referenced to be the same type?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?