Tenkes
Tenkes
Explore posts from servers
DTDrizzle Team
Created by Tenkes on 9/22/2024 in #help
PostgresError: foreign key constraint "product_categories_category_id_fk" cannot be implemented
wdym?
14 replies
DTDrizzle Team
Created by Tenkes on 9/22/2024 in #help
PostgresError: foreign key constraint "product_categories_category_id_fk" cannot be implemented
I can't add { onDelete: 'cascade' } if I'm using relations?
14 replies
DTDrizzle Team
Created by Tenkes on 9/22/2024 in #help
PostgresError: foreign key constraint "product_categories_category_id_fk" cannot be implemented
omg that's just amazing.. THANKS!
14 replies
DTDrizzle Team
Created by Tenkes on 9/22/2024 in #help
PostgresError: foreign key constraint "product_categories_category_id_fk" cannot be implemented
Yep, that worked! Thanks a bunch, I didn't even know relations was a thing lol
14 replies
DTDrizzle Team
Created by Tenkes on 9/22/2024 in #help
PostgresError: foreign key constraint "product_categories_category_id_fk" cannot be implemented
So my schema.ts looks something like:
const id = uuid('id').primaryKey().defaultRandom().notNull()

export const category = pgTable('category', {
id,
name: text('name').notNull()
})

export const products = pgTable('product', {
id,
// ...
})
const id = uuid('id').primaryKey().defaultRandom().notNull()

export const category = pgTable('category', {
id,
name: text('name').notNull()
})

export const products = pgTable('product', {
id,
// ...
})
14 replies
DTDrizzle Team
Created by Tenkes on 9/22/2024 in #help
PostgresError: foreign key constraint "product_categories_category_id_fk" cannot be implemented
I already did, just didn't include it here: const id = uuid('id').primaryKey().defaultRandom().notNull()
14 replies
DTDrizzle Team
Created by Tenkes on 9/22/2024 in #help
PostgresError: foreign key constraint "product_categories_category_id_fk" cannot be implemented
14 replies