KitAstro
KitAstro
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
I'm probably overthinking it I want a refund that applies generally
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
I was obviously messing around with the database structure trying to get the correct structure
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
I changed it and it worked
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
But don't know how to do that
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
I want an "null" id
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
message sender?
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
export const refund_relations = relations(refund, ({ one, many }) => ({ purchase: one(purchase, { fields: [refund.purchase_id], references: [purchase.id], }), items: many(refund_item), }))
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
export const purchase_relations = relations(purchase, ({ many }) => ({ items: many(purchase_item), refunds: many(refund), }))
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
I have the soft relations all set up already ^^
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
I'll program some more and find out. I don't expect this to be a problem. Maybe I'm overengineering a bit
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
I just want to have an order to apply the refunds in, I can obviously count it manually. But I thought about whether there was a way to do it automatically on sql-insert. ATM I'm not using it much but I just want to be sure that I'm certain about the order in which the refunds should be applied.
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
refunds are many purchase is one
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
it should be the count of refunds linking to the purchase
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
i don't know exactly how to do the sql
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
something like
order default count(purchase_id) from refund
order default count(purchase_id) from refund
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
I want to have the order field default to its insertion order
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
so its a many to one relation
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
each refund attaches to a purchase
35 replies
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
order is the field that determines which order the refund should be applied.
35 replies