Add indexes.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- create index joblines_line_no_sort on joblines (jobid, line_no asc);
|
||||
@@ -0,0 +1 @@
|
||||
create index joblines_line_no_sort on joblines (jobid, line_no asc);
|
||||
@@ -140,7 +140,6 @@ export const QUERY_JOB_BY_CLM_NO = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
export const QUERY_CLOSE_DATE_BY_CLM_NO = gql`
|
||||
query QUERY_CLOSE_DATE_BY_CLM_NO($clm_no: String!) {
|
||||
jobs(where: { clm_no: { _eq: $clm_no } }) {
|
||||
@@ -171,7 +170,7 @@ export const UPDATE_JOB = gql`
|
||||
group
|
||||
group_verified
|
||||
requires_reimport
|
||||
joblines(order_by: { unq_seq: asc }) {
|
||||
joblines(order_by: { line_no: asc }) {
|
||||
id
|
||||
act_price
|
||||
db_price
|
||||
|
||||
@@ -114,7 +114,16 @@ export async function UpsertEstimate(job) {
|
||||
variables: {
|
||||
job: { ...job, bodyshopid: shopId },
|
||||
},
|
||||
refetchQueries: ["QUERY_ALL_JOBS_PAGINATED", "QUERY_JOB_BY_PK"],
|
||||
update(cache, { data }) {
|
||||
cache.modify({
|
||||
fields: {
|
||||
jobs(existingJobs) {
|
||||
return [data.insert_jobs.returning[0], ...existingJobs];
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
// refetchQueries: ["QUERY_ALL_JOBS_PAGINATED", "QUERY_JOB_BY_PK"],
|
||||
});
|
||||
logger.info("Job inserted succesfully.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user