-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating hasMany => through relationships #720
Comments
Also, to get
The following code ran the seeds successfully: import __fixtures__ from './__fixtures__.json'
const CHUNK_SIZE = 100
export default async function seed(trx) {
const promises = Object
.keys(__fixtures__)
.map(key => [
key,
__fixtures__[key].map(row => (
Object.assign(row, {
created_at: new Date(row.created_at),
updated_at: new Date(row.updated_at),
})
))
])
.reduce((arr, [table, rows]) => {
arr[arr.length] = trx
.batchInsert(table, rows, CHUNK_SIZE)
.transacting(trx)
return arr
}, [])
return Promise.all(promises)
} |
@willviles I was able to reproduce your issue regarding updating has many through relationships. I'm going to look into this a bit deeper and see if there is an easy fix. In the mean time, could you expose the Add RelationshipPOST /friendships HTTP/1.1
Content-Type: application/vnd.api+json
Content-Length: 282
{
"data": {
"type": "friendships",
"relationships": {
"follower": {
"data": {
"id": ":id",
"type": "users"
}
},
"followee": {
"data": {
"id": ":id",
"type": "users"
}
}
}
}
} Remove RelationshipDELETE /friendships/:id HTTP/1.1 |
Platform: Darwin Kernel Version 16.7.0
Database: Tested w/SQLite3 & pg (assumed present on all dbs)
Lux Version: 1.2.1
Node Version: 6.10
To replicate this error, use the Lux test app inside the Lux repo.
reactions
andtags
to app/controllers/posts.js params./posts/1
with the following body to confirmreactions
update properly:/posts/1
with the following body:Error: SQLITE_ERROR: no such column: post_id
.It appears Lux is trying to update the relationship as though there's no joining
categorization
resource.The text was updated successfully, but these errors were encountered: