Skip to content
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

Fix objection models #70

Merged
merged 5 commits into from
Dec 21, 2022
Merged

Fix objection models #70

merged 5 commits into from
Dec 21, 2022

Conversation

Jozzey
Copy link
Contributor

@Jozzey Jozzey commented Dec 21, 2022

We have found that we are not supporting schemas in the proper way and we haven't been using the correct case in our models.

We have found that we are not supporting schemas in the proper way and we haven't been using the correct case in our models.
@Jozzey Jozzey added the bug Something isn't working label Dec 21, 2022
@Jozzey Jozzey self-assigned this Dec 21, 2022
@Jozzey Jozzey marked this pull request as ready for review December 21, 2022 13:50
@Jozzey Jozzey requested a review from Cruikshanks December 21, 2022 13:50
@Jozzey Jozzey merged commit ada4598 into main Dec 21, 2022
@Jozzey Jozzey deleted the fix-objection-models branch December 21, 2022 13:56
Cruikshanks added a commit that referenced this pull request Dec 22, 2022
In a [previous change](#70) we had to fix our Objection implementation because we realised

- our way of handling multiple schemas (using `tableName`) was [invalid](Vincit/objection.js#85 (comment))
- we were using the wrong case (snake vs camel) in most places. Under the hood Knex was fine, but once we leant into Objection relationships `withGraphFetched()` was bringing back nothing

What this highlighted was our existing model tests weren't really doing anything. Sure, a query can get generated but till you run them and confirm a result you can't be sure they are working as expected.

So, this change updates our model relationship tests to insert some data and confirm we get expected results back.
@Cruikshanks Cruikshanks mentioned this pull request Dec 22, 2022
Cruikshanks added a commit that referenced this pull request Dec 22, 2022
In a [previous change](#70) we had to fix our Objection implementation because we realised

- our way of handling multiple schemas (using `tableName`) was [invalid](Vincit/objection.js#85 (comment))
- we were using the wrong case (snake vs camel) in most places. Under the hood Knex was fine, but once we leant into Objection relationships `withGraphFetched()` was bringing back nothing

What this highlighted was our existing model tests weren't really doing anything. Sure, a query can get generated but till you run them and confirm a result you can't be sure they are working as expected.

So, this change updates our model relationship tests to insert some data and confirm we get expected results back.
Cruikshanks added a commit that referenced this pull request Dec 23, 2022
In a [previous change](#70) we had to fix our Objection implementation because we realised

- our way of handling multiple schemas (using `tableName`) was [invalid](Vincit/objection.js#85 (comment))
- we were using the wrong case (snake vs camel) in most places. Under the hood Knex was fine, but once we leant into Objection relationships `withGraphFetched()` was bringing back nothing

What this highlighted was our existing model tests weren't really doing anything. Sure, a query can get generated but till you run them and confirm a result you can't be sure they are working as expected.

So, this change updates our model relationship tests to insert some data and confirm we get expected results back.
Cruikshanks added a commit that referenced this pull request Dec 23, 2022
In a [previous change](#70) we had to fix our Objection implementation because we realised

- our way of handling multiple schemas (using `tableName`) was [invalid](Vincit/objection.js#85 (comment))
- we were using the wrong case (snake vs camel) in most places. Under the hood Knex was fine, but once we leant into Objection relationships `withGraphFetched()` was bringing back nothing

What this highlighted was our existing model tests weren't really doing anything. Sure, a query can get generated but till you run them and confirm a result you can't be sure they are working as expected.

So, this change updates our model relationship tests to insert some data and confirm we get the expected results back.

**Notes - includes a couple of fixes in the models and how the relationships were defined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants