_Pear
_Pear
Explore posts from servers
DTDrizzle Team
Created by Paddy on 3/4/2024 in #help
Composite primary key, multiple primary keys
I am. Often my migration or push:pg will fail. The raw SQL from the migration file seemed to mostly work though. I'll try to file a proper issue if I can reproduce it reliably.
4 replies
DTDrizzle Team
Created by Paddy on 3/4/2024 in #help
Composite primary key, multiple primary keys
I'm getting the same error using neondb. Also following the same lucia auth docs 🙂
4 replies
DTDrizzle Team
Created by _Pear on 3/3/2024 in #help
Is it possible to store an array of primary keys for table A on table B using Postgres?
I was able to get this solved by redoing some of my tables and making a one-to-many relationship. I think I had the tables swapped before but this setup makes more sense. Thanks!
7 replies
DTDrizzle Team
Created by _Pear on 3/3/2024 in #help
Is it possible to store an array of primary keys for table A on table B using Postgres?
In any case, yes, you cannot have multiple primary keys in a single table, but you can have composite primary keys (PKs that constitute of two or more columns).
Going to try this too.
7 replies
DTDrizzle Team
Created by _Pear on 3/3/2024 in #help
Is it possible to store an array of primary keys for table A on table B using Postgres?
Asking this another way: How can I cast uuid or text to uuid[] or text[]? The .array() method seems to work in theory but when I try to apply changes with it I get: Key columns "images" and "path" are of incompatible types: text[] and text.
7 replies
DTDrizzle Team
Created by _Pear on 3/3/2024 in #help
Is it possible to store an array of primary keys for table A on table B using Postgres?
in other words, in your example, is it possible to make the created_by_id column to be an array of user ids?
7 replies
DTDrizzle Team
Created by _Pear on 3/3/2024 in #help
Is it possible to store an array of primary keys for table A on table B using Postgres?
Hey thanks for the answer.. Im not sure that's what im looking for. Could that array only reference one key instead of two? I only have one primary key on table A. in table B i want to store an array of references to those primary keys. So this is still the way to achieve that?
7 replies