mariojuanaaa
mariojuanaaa
DTDrizzle Team
Created by mariojuanaaa on 4/5/2024 in #help
foreign key mismatch
The goal is to have a unique constraint on the Product.product_num, Store.store_num and Store.chain_name. Basically i want a product to be unique in a given store_num and chain_name. ie, there can only be 1 product abc123 at walmart #5123 Your response from my understanding is adding a foreign key, which i can do, but i want the unique contraint to be added
6 replies
DTDrizzle Team
Created by mariojuanaaa on 4/5/2024 in #help
foreign key mismatch
instead of unique: unique().on(t.product_num, t.store_num, t.chainName) if i use unique: unique().on(t.product_num, Store.store_num, Store.chain_name) i get
LibsqlError: SQL_INPUT_ERROR: SQL input error: no such column: chain_name (at offset 112)
LibsqlError: SQL_INPUT_ERROR: SQL input error: no such column: chain_name (at offset 112)
OR
LibsqlError: SQL_INPUT_ERROR: SQL input error: no such column: store_num(at offset 99)
LibsqlError: SQL_INPUT_ERROR: SQL input error: no such column: store_num(at offset 99)
6 replies