this:
I have a users table, and I want to store all the vehicles owned by a user in an array inside the vehicles column .
I have a vehicles table separately and want to store unique IDs of all vehicles in the users vehicle array
I have previously worked with mongodb and in there I can implement as follows:
userSchema = {
...
vehicles: [ {type: mongoose.Types.ObjectId, ref: "Vehicle"} ]
...
}
how can I do the same in postgres ?
Can't store arrays in SQL
Обсуждают сегодня