diff --git a/client/public/index.html b/client/public/index.html index 5111aa45c..42bbab0b2 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -31,15 +31,5 @@
- diff --git a/client/src/assets/unfolded_car.svg b/client/src/assets/unfolded_car.svg new file mode 100644 index 000000000..326293fd1 --- /dev/null +++ b/client/src/assets/unfolded_car.svg @@ -0,0 +1,820 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/src/components/job-detail-cards/job-detail-cards.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.component.jsx index f40ea86b5..4eb7469d4 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.component.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { useQuery } from "@apollo/react-hooks"; import AlertComponent from "../alert/alert.component"; @@ -17,6 +17,8 @@ import JobDetailCardsTotalsComponent from "./job-detail-cards.totals.component"; import JobDetailCardsDocumentsComponent from "./job-detail-cards.documents.component"; import "./job-detail-cards.styles.scss"; +import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; +import NoteAddModal from "../note-add-modal/note-add-modal.component"; export default function JobDetailCards({ selectedJob }) { const { loading, error, data } = useQuery(QUERY_JOB_CARD_DETAILS, { @@ -24,6 +26,7 @@ export default function JobDetailCards({ selectedJob }) { variables: { id: selectedJob }, skip: !selectedJob }); + const [noteModalVisible, setNoteModalVisible] = useState(false); const { t } = useTranslation(); @@ -31,85 +34,106 @@ export default function JobDetailCards({ selectedJob }) { return
{t("jobs.errors.nojobselected")}
; } - if (error) return ; - console.log("data", data); - return ( - window.history.back()} - tags={{data?.jobs_by_pk.job_status?.name}} - title={ - data?.jobs_by_pk.ro_number - ? `${t("jobs.fields.ro_number")} ${data?.jobs_by_pk.ro_number}` - : `${t("jobs.fields.est_number")} ${data?.jobs_by_pk.est_number}` - } - extra={[ - , - , - , - - ]} - > - - Lili Qu - 421421 - 2017-01-10 - 2017-10-10 - - Gonghu Road, Xihu District, Hangzhou, Zhejiang, China - - + if (error) return ; -
- - - - - - - - - -
-
+ return ( +
+ + window.history.back()} + tags={{data?.jobs_by_pk.job_status?.name}} + title={ + loading + ? t("general.labels.loading") + : data?.jobs_by_pk.ro_number + ? `${t("jobs.fields.ro_number")} ${data?.jobs_by_pk.ro_number}` + : `${t("jobs.fields.est_number")} ${data?.jobs_by_pk.est_number}` + } + extra={[ + , + , + , + + ]}> + {loading ? ( + + ) : ( + + Lili Qu + 421421 + + 2017-01-10 + + + 2017-10-10 + + + Gonghu Road, Xihu District, Hangzhou, Zhejiang, China + + + )} + +
+ + + + + + + + + +
+
+
); } diff --git a/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx index 861037a34..fea7c0ed0 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx @@ -1,6 +1,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; import CardTemplate from "./job-detail-cards.template.component"; +import UnfoldedCar from "../../assets/unfolded_car.svg"; export default function JobDetailCardsDamageComponent({ loading, data }) { const { t } = useTranslation(); @@ -9,7 +10,7 @@ export default function JobDetailCardsDamageComponent({ loading, data }) { {data ? ( - Damage stuff here. + Damaged Area ) : null} diff --git a/client/src/components/job-detail-cards/job-detail-cards.dates.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.dates.component.jsx index 50e108b9a..d329d1f58 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.dates.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.dates.component.jsx @@ -2,6 +2,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; import CardTemplate from "./job-detail-cards.template.component"; import Moment from "react-moment"; +import { Timeline } from "antd"; export default function JobDetailCardsDatesComponent({ loading, data }) { const { t } = useTranslation(); @@ -9,11 +10,15 @@ export default function JobDetailCardsDatesComponent({ loading, data }) { return ( {data ? ( - - Actual In {data?.actual_in} - Scheduled Completion - {data?.scheduled_completion} - + + + Actual In {data?.actual_in} + + + Scheduled Completion + {data?.scheduled_completion} + + ) : null} ); diff --git a/client/src/components/job-detail-cards/job-detail-cards.notes.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.notes.component.jsx index 3fc2ccaf7..20b761ba7 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.notes.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.notes.component.jsx @@ -1,6 +1,13 @@ +import { List, Icon } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import CardTemplate from "./job-detail-cards.template.component"; +import styled from "styled-components"; + +const Container = styled.div` + height: 100%; + overflow-y: auto; +`; export default function JobDetailCardsNotesComponent({ loading, data }) { const { t } = useTranslation(); @@ -8,9 +15,24 @@ export default function JobDetailCardsNotesComponent({ loading, data }) { return ( {data ? ( - - notes stuff here. - + + ( + + {item.critical ? ( + + ) : null} + {item.private ? ( + + ) : null} + {item.text} + + )} + /> + ) : null} ); diff --git a/client/src/components/job-detail-cards/job-detail-cards.styles.scss b/client/src/components/job-detail-cards/job-detail-cards.styles.scss index 726e8e82a..bd2a6fb18 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.styles.scss +++ b/client/src/components/job-detail-cards/job-detail-cards.styles.scss @@ -1,32 +1,36 @@ +.job-cards-container { + height: 45vh; + overflow-y: auto; +} + .job-cards { - display: flex; - flex-wrap: wrap; - } + display: flex; + flex-wrap: wrap; +} .job-card { - - margin: .5em; + margin: 0.5em; } @media screen and (min-width: 40em) { - .card { - max-width: calc(50% - 1em); - } + .card { + max-width: calc(50% - 1em); + } } @media screen and (min-width: 60em) { - .card { - max-width: calc(25% - 1em); - } + .card { + max-width: calc(25% - 1em); + } } .centered { - margin: 0 auto; - padding: 0 1em; + margin: 0 auto; + padding: 0 1em; } @media screen and (min-width: 52em) { - .centered { - max-width: 52em; - } -} \ No newline at end of file + .centered { + max-width: 52em; + } +} diff --git a/client/src/components/job-detail-cards/job-detail-cards.template.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.template.component.jsx index 1247fce4f..30a854346 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.template.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.template.component.jsx @@ -13,7 +13,7 @@ export default function JobDetailCardTemplate({ return ( {jobContext?.job_status?.name}} extra={[ @@ -102,7 +102,7 @@ function JobTombstone({ job, ...otherProps }) { ]}> - + {jobContext.vehicle?.v_model_yr ?? t("general.labels.na")}{" "} {jobContext.vehicle?.v_make_desc ?? t("general.labels.na")}{" "} @@ -185,4 +185,4 @@ function JobTombstone({ job, ...otherProps }) { ); } -export default Form.create({ name: "JobTombstone" })(JobTombstone); \ No newline at end of file +export default Form.create({ name: "JobTombstone" })(JobTombstone); diff --git a/client/src/components/jobs-list/jobs-list.component.jsx b/client/src/components/jobs-list/jobs-list.component.jsx index 1b2bbe07d..30af167ed 100644 --- a/client/src/components/jobs-list/jobs-list.component.jsx +++ b/client/src/components/jobs-list/jobs-list.component.jsx @@ -1,10 +1,12 @@ +import { Input, Table, Icon } from "antd"; import React, { useState } from "react"; -import { Link } from "react-router-dom"; -import { Table, Icon, Input, Dropdown, Menu } from "antd"; -import { alphaSort } from "../../utils/sorters"; import { useTranslation } from "react-i18next"; +import { Link } from "react-router-dom"; +import PhoneFormatter from "../../utils/PhoneFormatter"; +import { alphaSort } from "../../utils/sorters"; +import "./jobs-list.styles.scss"; -export default function JobsPage({ +export default function JobsList({ loading, jobs, selectedJob, @@ -17,38 +19,9 @@ export default function JobsPage({ const { t } = useTranslation(); - const actionMenu = ( - - - - {t("jobs.actions.viewJobImages")} - - - - {t("jobs.actions.printCenter")} - - - - {t("jobs.actions.notes")} - - - - {t("jobs.actions.postInvoices")} - - - - {t("jobs.actions.receiveParts")} - - - - {t("jobs.actions.partStatus")} - - - ); - const columns = [ { - title: "RO #", + title: t("jobs.fields.ro_number"), dataIndex: "ro_number", key: "ro_number", // onFilter: (value, record) => record.ro_number.includes(value), @@ -56,67 +29,144 @@ export default function JobsPage({ sorter: (a, b) => alphaSort(a, b), sortOrder: state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order, - ellipsis: true, + render: (text, record) => ( - {record.ro_number} + + {record.ro_number ? record.ro_number : t("general.labels.na")} + ) }, { - title: "Est. #", - dataIndex: "est_number", - key: "est_number" + title: t("jobs.fields.owner"), + dataIndex: "owner", + key: "owner", + ellipsis: true, + sorter: (a, b) => alphaSort(a.pit_owner_last_name, b.pit_owner_last_name), + sortOrder: + state.sortedInfo.columnKey === "owner" && state.sortedInfo.order, + render: (text, record) => { + return record.owner ? ( + + {record.pit_owner_first_name} {record.pit_owner_last_name} + + ) : ( + t("jobs.errors.noowner") + ); + } }, { - title: "Status", + title: t("jobs.fields.phone1"), + dataIndex: "pit_owner_phone", + key: "pit_owner_phone", + ellipsis: true, + render: (text, record) => { + return record.pit_owner_phone ? ( + + {record.pit_owner_phone} + { + alert("SMSing will happen here."); + }} + /> + + ) : ( + t("general.labels.unknown") + ); + } + }, + { + title: t("jobs.fields.status"), dataIndex: "status", key: "status", + ellipsis: true, sorter: (a, b) => alphaSort(a, b), sortOrder: state.sortedInfo.columnKey === "status" && state.sortedInfo.order, - ellipsis: true, render: (text, record) => { - return record.job_status?.name ?? ""; + return record.job_status?.name ?? t("general.labels.na"); } }, + { - title: "Customer", - dataIndex: "customer", - key: "customer", - render: (text, record) => { - return record.owner ? ( -
- {record.owner.first_name} {record.owner.last_name} -
- ) : ( - "No Customer" - ); - } - }, - { - title: "Vehicle", + title: t("jobs.fields.vehicle"), dataIndex: "vehicle", key: "vehicle", + ellipsis: true, render: (text, record) => { return record.vehicle ? ( -
+ {record.vehicle.v_model_yr} {record.vehicle.v_make_desc}{" "} {record.vehicle.v_model_desc} -
+ ) : ( - "No Vehicle" + t("jobs.errors.novehicle") ); } }, { - title: "Action", - key: "action", - render: (text, record) => ( - - - - ) + title: t("vehicles.fields.plate_no"), + dataIndex: "plate_no", + key: "plate_no", + ellipsis: true, + sorter: (a, b) => alphaSort(a, b), + sortOrder: + state.sortedInfo.columnKey === "plate_no" && state.sortedInfo.order, + render: (text, record) => { + return record.vehicle?.plate_no ? ( + {record.vehicle.plate_no} + ) : ( + t("general.labels.unknown") + ); + } + }, + { + title: t("jobs.fields.clm_no"), + dataIndex: "clm_no", + key: "clm_no", + ellipsis: true, + sorter: (a, b) => alphaSort(a, b), + sortOrder: + state.sortedInfo.columnKey === "clm_no" && state.sortedInfo.order, + render: (text, record) => { + return record.clm_no ? ( + {record.clm_no} + ) : ( + t("general.labels.unknown") + ); + } + }, + { + title: t("jobs.fields.clm_total"), + dataIndex: "clm_total", + key: "clm_total", + sorter: (a, b) => { + return a > b; + }, + sortOrder: + state.sortedInfo.columnKey === "clm_total" && state.sortedInfo.order, + render: (text, record) => { + return record.clm_total ? ( + {record.clm_total} + ) : ( + t("general.labels.unknown") + ); + } + }, + { + title: t("jobs.fields.owner_owing"), + dataIndex: "owner_owing", + key: "owner_owing", + render: (text, record) => { + return record.owner_owing ? ( + {record.owner_owing} + ) : ( + t("general.labels.unknown") + ); + } } ]; @@ -140,19 +190,22 @@ export default function JobsPage({ }; return ( -
- console.log(value)} - enterButton - /> -
- +
{ + return ( + console.log(value)} + enterButton + /> + ); + }} + size='small' pagination={{ position: "top" }} columns={columns.map(item => ({ ...item }))} - rowKey="id" + rowKey='id' dataSource={jobs} rowSelection={{ selectedRowKeys: [selectedJob] }} onChange={handleTableChange} diff --git a/client/src/components/jobs-list/jobs-list.styles.scss b/client/src/components/jobs-list/jobs-list.styles.scss new file mode 100644 index 000000000..04944afb2 --- /dev/null +++ b/client/src/components/jobs-list/jobs-list.styles.scss @@ -0,0 +1,4 @@ +.jobs-list{ + text-align: center; + height: 40vh; +} \ No newline at end of file diff --git a/client/src/components/loading-skeleton/loading-skeleton.component.jsx b/client/src/components/loading-skeleton/loading-skeleton.component.jsx index ce9a731ac..ecfdec0d2 100644 --- a/client/src/components/loading-skeleton/loading-skeleton.component.jsx +++ b/client/src/components/loading-skeleton/loading-skeleton.component.jsx @@ -1,10 +1,8 @@ -import React from 'react' -import './loading-skeleton.styles.scss' +import React from "react"; +import "./loading-skeleton.styles.scss"; import { Skeleton } from "antd"; -export default function LoadingSkeleton() { - return ( - - ) +export default function LoadingSkeleton(props) { + return ; } diff --git a/client/src/components/note-add-modal/note-add-modal.component.jsx b/client/src/components/note-add-modal/note-add-modal.component.jsx new file mode 100644 index 000000000..2b25ad68e --- /dev/null +++ b/client/src/components/note-add-modal/note-add-modal.component.jsx @@ -0,0 +1,75 @@ +import { Input, Modal, Switch } from "antd"; +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { useMutation } from "react-apollo"; +import { INSERT_NEW_NOTE } from "../../graphql/notes.queries"; + +export default function NoteAddModal({ jobId, visible, changeVisibility }) { + const [newNote, setnewNote] = useState({ + private: false, + critical: false, + text: "" + }); + const { t } = useTranslation(); + const [insertNote] = useMutation(INSERT_NEW_NOTE); + + return ( + { + insertNote({ + variables: { + noteInput: [ + { ...newNote, jobid: jobId, created_by: "patrick@bodyshop.app" } + ] + } + }).then(r => { + setnewNote({ + private: false, + critical: false, + text: "" + }); + }); + + changeVisibility(!visible); + }} + onCancel={() => { + changeVisibility(!visible); + setnewNote({ + private: false, + critical: false, + text: "" + }); + }}> +
+ {t("notes.fields.critical")} + { + setnewNote({ ...newNote, critical: checked }); + }} + /> +
+
+ {t("notes.fields.private")} + { + setnewNote({ ...newNote, private: checked }); + }} + /> +
+ + { + setnewNote({ ...newNote, text: e.target.value }); + }} + /> +
+ ); +} diff --git a/client/src/graphql/apollo-error-handling.js b/client/src/graphql/apollo-error-handling.js index deaa02861..5ef59bdad 100644 --- a/client/src/graphql/apollo-error-handling.js +++ b/client/src/graphql/apollo-error-handling.js @@ -11,49 +11,49 @@ const errorLink = onError( console.log("forward", forward); //if (graphQLErrors) { // User access token has expired - // if (graphQLErrors[0].message.includes("JWTExpired")) { - console.log("Got to the error check."); - if (access_token && access_token !== "undefined") { - // Let's refresh token through async request - return new Observable(observer => { - auth.currentUser - .getIdToken(true) - .then(function(idToken) { - if (!idToken) { - window.localStorage.removeItem("token"); - return console.log("Refresh token has expired"); - } - console.log("Got a new token", idToken); - window.localStorage.setItem("token", idToken); - - // reset the headers - operation.setContext(({ headers = {} }) => ({ - headers: { - // Re-add old headers - ...headers, - // Switch out old access token for new one - authorization: idToken ? `Bearer ${idToken}` : "" + if (networkError.message.includes("JWTExpired")) { + console.log("Got to the error check."); + if (access_token && access_token !== "undefined") { + // Let's refresh token through async request + return new Observable(observer => { + auth.currentUser + .getIdToken(true) + .then(function(idToken) { + if (!idToken) { + window.localStorage.removeItem("token"); + return console.log("Refresh token has expired"); } - })); + console.log("Got a new token", idToken); + window.localStorage.setItem("token", idToken); - const subscriber = { - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer) - }; - console.log("About to resend the request."); - // Retry last failed request - forward(operation).subscribe(subscriber); - }) - .catch(error => { - // No refresh or client token available, we force user to login - console.log("Hit an error."); - observer.error(error); - }); - }); + // reset the headers + operation.setContext(({ headers = {} }) => ({ + headers: { + // Re-add old headers + ...headers, + // Switch out old access token for new one + authorization: idToken ? `Bearer ${idToken}` : "" + } + })); + + // const subscriber = { + // next: observer.next.bind(observer), + // error: observer.error.bind(observer), + // complete: observer.complete.bind(observer) + // }; + console.log("About to resend the request."); + // Retry last failed request + forward(operation); //.subscribe(subscriber); + }) + .catch(error => { + // No refresh or client token available, we force user to login + console.log("Hit an error."); + observer.error(error); + }); + }); + } } //} - //} if (networkError) { console.log(`[Network error]: ${networkError}`); diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 7d63d8d1d..8ee2824d0 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -30,27 +30,61 @@ export const GET_ALL_OPEN_JOBS = gql` export const SUBSCRIPTION_ALL_OPEN_JOBS = gql` subscription SUBSCRIPTION_ALL_OPEN_JOBS { jobs { - id - updated_at - est_number - ro_number - job_status { - name + pit_owner_first_name + pit_owner_last_name + pit_owner_phone + pit_owner_email + owner { id + allow_text_message + preferred_contact } - scheduled_completion - scheduled_delivery vehicle { id v_model_yr v_make_desc v_model_desc + v_color plate_no } - owner { + pit_vehicle_plate_no + actual_completion + actual_delivery + actual_in + est_number + id + ins_co_nm + ins_ct_fn + ins_ct_ln + ins_ph1 + ins_ea + est_co_nm + est_ph1 + est_ea + est_ct_fn + est_ct_ln + clm_no + clm_total + owner_owing + ro_number + scheduled_completion + scheduled_in + scheduled_delivery + job_status { id - first_name - last_name + name + } + updated_at + claim_total + ded_amt + vehicle { + id + plate_no + v_vin + v_model_yr + v_model_desc + v_make_desc + v_color } } } @@ -200,6 +234,13 @@ export const QUERY_JOB_CARD_DETAILS = gql` scheduled_completion scheduled_in scheduled_delivery + notes { + id + text + critical + private + created_at + } job_status { id name diff --git a/client/src/graphql/notes.queries.js b/client/src/graphql/notes.queries.js new file mode 100644 index 000000000..8ad02f359 --- /dev/null +++ b/client/src/graphql/notes.queries.js @@ -0,0 +1,11 @@ +import { gql } from "apollo-boost"; + +export const INSERT_NEW_NOTE = gql` + mutation INSERT_NEW_JOB($noteInput: [notes_insert_input!]!) { + insert_notes(objects: $noteInput) { + returning { + id + } + } + } +`; diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 45480ef6c..713fe902a 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -11,7 +11,8 @@ "out": "Out", "na": "N/A", "unknown": "Unknown", - "save": "Save" + "save": "Save", + "loading": "Loading..." } }, "menus": { @@ -38,6 +39,23 @@ } }, + "vehicles": { + "fields": { + "plate_no": "License Plate" + } + }, + + "notes": { + "labels": { + "newnoteplaceholder": "Add a note..." + }, + "fields": { + "critical": "Critical", + "private": "Private", + "text": "Contents" + } + }, + "jobs": { "labels": { "cards": { @@ -50,18 +68,23 @@ "notes": "Notes", "damage": "Area of Damage", "totals": "Totals", - "filehandler" : "File Handler", - "appraiser" : "Appraiser", - "estimator" : "Estimator" + "filehandler": "File Handler", + "appraiser": "Appraiser", + "estimator": "Estimator" }, - "no_owner": "No Owner", "vehicle_info": "Vehicle" }, "fields": { "ro_number": "RO #", "est_number": "Estimate Number", - "claim_total": "Claim Total", - "deductible": "Deductible" + "clm_total": "Claim Total", + "deductible": "Deductible", + "owner": "Owner", + "status": "Job Status", + "vehicle": "Vehicle", + "phone1": "Phone 1", + "clm_no": "Claim #", + "owner_owing": "Cust. Owes" }, "successes": { "save": "Record Saved", @@ -72,7 +95,9 @@ "validationtitle": "Validation Error", "validation": "Please ensure all fields are entered correctly.", "saving": "Error encountered while saving record.", - "nojobselected": "No job is selected." + "nojobselected": "No job is selected.", + "noowner": "No owner associated.", + "novehicle": "No vehicle associated." }, "actions": { "addDocuments": "Add Job Documents", diff --git a/hasura/migrations/1578954223847_alter_table_public_jobs_add_column_clm_total/down.yaml b/hasura/migrations/1578954223847_alter_table_public_jobs_add_column_clm_total/down.yaml new file mode 100644 index 000000000..2eaedb102 --- /dev/null +++ b/hasura/migrations/1578954223847_alter_table_public_jobs_add_column_clm_total/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "clm_total"; + type: run_sql diff --git a/hasura/migrations/1578954223847_alter_table_public_jobs_add_column_clm_total/up.yaml b/hasura/migrations/1578954223847_alter_table_public_jobs_add_column_clm_total/up.yaml new file mode 100644 index 000000000..cdfffd96b --- /dev/null +++ b/hasura/migrations/1578954223847_alter_table_public_jobs_add_column_clm_total/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "clm_total" numeric NULL; + type: run_sql diff --git a/hasura/migrations/1578954425812_alter_table_public_jobs_add_column_owner_owing/down.yaml b/hasura/migrations/1578954425812_alter_table_public_jobs_add_column_owner_owing/down.yaml new file mode 100644 index 000000000..b32ee730c --- /dev/null +++ b/hasura/migrations/1578954425812_alter_table_public_jobs_add_column_owner_owing/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "owner_owing"; + type: run_sql diff --git a/hasura/migrations/1578954425812_alter_table_public_jobs_add_column_owner_owing/up.yaml b/hasura/migrations/1578954425812_alter_table_public_jobs_add_column_owner_owing/up.yaml new file mode 100644 index 000000000..fdda24801 --- /dev/null +++ b/hasura/migrations/1578954425812_alter_table_public_jobs_add_column_owner_owing/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "owner_owing" numeric NULL; + type: run_sql diff --git a/hasura/migrations/1578954579180_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1578954579180_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..60be69909 --- /dev/null +++ b/hasura/migrations/1578954579180_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,120 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - ded_status + - inproduction + - asgn_date + - invoice_date + - claim_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - state_tax_rate + - asgn_no + - asgn_type + - clm_no + - clm_ofc_id + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - pit_owner_email + - pit_owner_first_name + - pit_owner_last_name + - pit_owner_phone + - pit_vehicle_plate_no + - policy_no + - regie_number + - ro_number + - actual_completion + - actual_delivery + - actual_in + - scheduled_completion + - scheduled_delivery + - scheduled_in + - created_at + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1578954579180_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1578954579180_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..716de8355 --- /dev/null +++ b/hasura/migrations/1578954579180_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,128 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - shopid + - est_number + - ro_number + - ownerid + - vehicleid + - labor_rate_id + - labor_rate_desc + - rate_lab + - rate_lad + - rate_lae + - rate_lar + - rate_las + - rate_laf + - rate_lam + - rate_lag + - rate_atp + - rate_lau + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_mapa + - rate_mash + - rate_mahw + - rate_ma2s + - rate_ma3s + - rate_ma2t + - rate_mabl + - rate_macs + - rate_matd + - federal_tax_rate + - state_tax_rate + - local_tax_rate + - est_co_nm + - est_addr1 + - est_addr2 + - est_city + - est_st + - est_zip + - est_ctry + - est_ph1 + - est_ea + - est_ct_ln + - est_ct_fn + - scheduled_in + - actual_in + - scheduled_completion + - actual_completion + - scheduled_delivery + - actual_delivery + - regie_number + - invoice_date + - claim_total + - deductible + - inproduction + - statusid + - pit_owner_first_name + - pit_owner_last_name + - pit_owner_phone + - pit_owner_email + - pit_vehicle_plate_no + - ins_co_id + - ins_co_nm + - ins_addr1 + - ins_addr2 + - ins_city + - ins_st + - ins_zip + - ins_ctry + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_fax + - ins_faxx + - ins_ct_ln + - ins_ct_fn + - ins_title + - ins_ct_ph + - ins_ct_phx + - ins_ea + - ins_memo + - policy_no + - ded_amt + - ded_status + - asgn_no + - asgn_date + - asgn_type + - clm_no + - clm_ofc_id + - date_estimated + - date_open + - date_scheduled + - date_invoiced + - date_closed + - date_exported + - clm_total + - owner_owing + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1578954585318_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1578954585318_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..b5c4d3fdd --- /dev/null +++ b/hasura/migrations/1578954585318_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,118 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - ded_status + - inproduction + - asgn_date + - invoice_date + - claim_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - state_tax_rate + - asgn_no + - asgn_type + - clm_no + - clm_ofc_id + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - pit_owner_email + - pit_owner_first_name + - pit_owner_last_name + - pit_owner_phone + - pit_vehicle_plate_no + - policy_no + - regie_number + - ro_number + - actual_completion + - actual_delivery + - actual_in + - scheduled_completion + - scheduled_delivery + - scheduled_in + - created_at + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: jobs + schema: public + type: create_select_permission diff --git a/hasura/migrations/1578954585318_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1578954585318_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..ae63fa93d --- /dev/null +++ b/hasura/migrations/1578954585318_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,126 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - ded_status + - inproduction + - asgn_date + - invoice_date + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - state_tax_rate + - asgn_no + - asgn_type + - clm_no + - clm_ofc_id + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - pit_owner_email + - pit_owner_first_name + - pit_owner_last_name + - pit_owner_phone + - pit_vehicle_plate_no + - policy_no + - regie_number + - ro_number + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: jobs + schema: public + type: create_select_permission diff --git a/hasura/migrations/1578954590633_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1578954590633_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..ddcb7f9e7 --- /dev/null +++ b/hasura/migrations/1578954590633_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,120 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - ded_status + - inproduction + - asgn_date + - invoice_date + - claim_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - state_tax_rate + - asgn_no + - asgn_type + - clm_no + - clm_ofc_id + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - pit_owner_email + - pit_owner_first_name + - pit_owner_last_name + - pit_owner_phone + - pit_vehicle_plate_no + - policy_no + - regie_number + - ro_number + - actual_completion + - actual_delivery + - actual_in + - scheduled_completion + - scheduled_delivery + - scheduled_in + - created_at + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_update_permission diff --git a/hasura/migrations/1578954590633_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1578954590633_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..578c534e8 --- /dev/null +++ b/hasura/migrations/1578954590633_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,128 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - ded_status + - inproduction + - asgn_date + - invoice_date + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_lab + - rate_lad + - rate_lae + - rate_laf + - rate_lag + - rate_lam + - rate_lar + - rate_las + - rate_lau + - rate_ma2s + - rate_ma2t + - rate_ma3s + - rate_mabl + - rate_macs + - rate_mahw + - rate_mapa + - rate_mash + - rate_matd + - state_tax_rate + - asgn_no + - asgn_type + - clm_no + - clm_ofc_id + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - pit_owner_email + - pit_owner_first_name + - pit_owner_last_name + - pit_owner_phone + - pit_vehicle_plate_no + - policy_no + - regie_number + - ro_number + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_update_permission diff --git a/hasura/migrations/1578961956675_create_table_public_notes/down.yaml b/hasura/migrations/1578961956675_create_table_public_notes/down.yaml new file mode 100644 index 000000000..11e57b2b4 --- /dev/null +++ b/hasura/migrations/1578961956675_create_table_public_notes/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: DROP TABLE "public"."notes" + type: run_sql diff --git a/hasura/migrations/1578961956675_create_table_public_notes/up.yaml b/hasura/migrations/1578961956675_create_table_public_notes/up.yaml new file mode 100644 index 000000000..fa7addea5 --- /dev/null +++ b/hasura/migrations/1578961956675_create_table_public_notes/up.yaml @@ -0,0 +1,21 @@ +- args: + sql: CREATE EXTENSION IF NOT EXISTS pgcrypto; + type: run_sql +- args: + sql: "CREATE TABLE \"public\".\"notes\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(), + \"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\" timestamptz + NOT NULL DEFAULT now(), \"jobid\" uuid NOT NULL, \"text\" text, \"created_by\" + text NOT NULL, \"critical\" boolean NOT NULL DEFAULT false, \"private\" boolean + NOT NULL DEFAULT false, PRIMARY KEY (\"id\") , FOREIGN KEY (\"jobid\") REFERENCES + \"public\".\"jobs\"(\"id\") ON UPDATE cascade ON DELETE cascade);\nCREATE OR + REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS + TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\" + = NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_notes_updated_at\"\nBEFORE + UPDATE ON \"public\".\"notes\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT + ON TRIGGER \"set_public_notes_updated_at\" ON \"public\".\"notes\" \nIS 'trigger + to set value of column \"updated_at\" to current timestamp on row update';\n" + type: run_sql +- args: + name: notes + schema: public + type: add_existing_table_or_view diff --git a/hasura/migrations/1578961968258_track_all_relationships/down.yaml b/hasura/migrations/1578961968258_track_all_relationships/down.yaml new file mode 100644 index 000000000..af2767edb --- /dev/null +++ b/hasura/migrations/1578961968258_track_all_relationships/down.yaml @@ -0,0 +1,12 @@ +- args: + relationship: notes + table: + name: jobs + schema: public + type: drop_relationship +- args: + relationship: job + table: + name: notes + schema: public + type: drop_relationship diff --git a/hasura/migrations/1578961968258_track_all_relationships/up.yaml b/hasura/migrations/1578961968258_track_all_relationships/up.yaml new file mode 100644 index 000000000..dd3840b30 --- /dev/null +++ b/hasura/migrations/1578961968258_track_all_relationships/up.yaml @@ -0,0 +1,20 @@ +- args: + name: notes + table: + name: jobs + schema: public + using: + foreign_key_constraint_on: + column: jobid + table: + name: notes + schema: public + type: create_array_relationship +- args: + name: job + table: + name: notes + schema: public + using: + foreign_key_constraint_on: jobid + type: create_object_relationship diff --git a/hasura/migrations/1578962007220_update_permission_user_public_table_notes/down.yaml b/hasura/migrations/1578962007220_update_permission_user_public_table_notes/down.yaml new file mode 100644 index 000000000..835a98c86 --- /dev/null +++ b/hasura/migrations/1578962007220_update_permission_user_public_table_notes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: notes + schema: public + type: drop_insert_permission diff --git a/hasura/migrations/1578962007220_update_permission_user_public_table_notes/up.yaml b/hasura/migrations/1578962007220_update_permission_user_public_table_notes/up.yaml new file mode 100644 index 000000000..e4124cf23 --- /dev/null +++ b/hasura/migrations/1578962007220_update_permission_user_public_table_notes/up.yaml @@ -0,0 +1,31 @@ +- args: + permission: + allow_upsert: true + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - jobid + - text + - created_by + - critical + - private + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: notes + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1578962015322_update_permission_user_public_table_notes/down.yaml b/hasura/migrations/1578962015322_update_permission_user_public_table_notes/down.yaml new file mode 100644 index 000000000..5c9678555 --- /dev/null +++ b/hasura/migrations/1578962015322_update_permission_user_public_table_notes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: notes + schema: public + type: drop_select_permission diff --git a/hasura/migrations/1578962015322_update_permission_user_public_table_notes/up.yaml b/hasura/migrations/1578962015322_update_permission_user_public_table_notes/up.yaml new file mode 100644 index 000000000..9d5a0ed17 --- /dev/null +++ b/hasura/migrations/1578962015322_update_permission_user_public_table_notes/up.yaml @@ -0,0 +1,28 @@ +- args: + permission: + allow_aggregations: false + columns: + - critical + - private + - created_by + - text + - created_at + - updated_at + - id + - jobid + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + limit: null + role: user + table: + name: notes + schema: public + type: create_select_permission diff --git a/hasura/migrations/1578962026938_update_permission_user_public_table_notes/down.yaml b/hasura/migrations/1578962026938_update_permission_user_public_table_notes/down.yaml new file mode 100644 index 000000000..45098e246 --- /dev/null +++ b/hasura/migrations/1578962026938_update_permission_user_public_table_notes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: notes + schema: public + type: drop_update_permission diff --git a/hasura/migrations/1578962026938_update_permission_user_public_table_notes/up.yaml b/hasura/migrations/1578962026938_update_permission_user_public_table_notes/up.yaml new file mode 100644 index 000000000..48d0645bd --- /dev/null +++ b/hasura/migrations/1578962026938_update_permission_user_public_table_notes/up.yaml @@ -0,0 +1,30 @@ +- args: + permission: + columns: + - critical + - private + - created_by + - text + - created_at + - updated_at + - id + - jobid + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: notes + schema: public + type: create_update_permission diff --git a/hasura/migrations/1578962038955_update_permission_user_public_table_notes/down.yaml b/hasura/migrations/1578962038955_update_permission_user_public_table_notes/down.yaml new file mode 100644 index 000000000..e8fcd2d32 --- /dev/null +++ b/hasura/migrations/1578962038955_update_permission_user_public_table_notes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: notes + schema: public + type: drop_delete_permission diff --git a/hasura/migrations/1578962038955_update_permission_user_public_table_notes/up.yaml b/hasura/migrations/1578962038955_update_permission_user_public_table_notes/up.yaml new file mode 100644 index 000000000..1120b3058 --- /dev/null +++ b/hasura/migrations/1578962038955_update_permission_user_public_table_notes/up.yaml @@ -0,0 +1,17 @@ +- args: + permission: + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: notes + schema: public + type: create_delete_permission diff --git a/hasura/migrations/1578962633097_set_fk_public_notes_created_by/down.yaml b/hasura/migrations/1578962633097_set_fk_public_notes_created_by/down.yaml new file mode 100644 index 000000000..f7806cfa9 --- /dev/null +++ b/hasura/migrations/1578962633097_set_fk_public_notes_created_by/down.yaml @@ -0,0 +1,4 @@ +- args: + sql: "\n alter table \"public\".\"notes\" drop constraint \"notes_created_by_fkey\"\n + \ " + type: run_sql diff --git a/hasura/migrations/1578962633097_set_fk_public_notes_created_by/up.yaml b/hasura/migrations/1578962633097_set_fk_public_notes_created_by/up.yaml new file mode 100644 index 000000000..a2fcd0193 --- /dev/null +++ b/hasura/migrations/1578962633097_set_fk_public_notes_created_by/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: "\n alter table \"public\".\"notes\"\n add constraint + \"notes_created_by_fkey\"\n foreign key (\"created_by\")\n references + \"public\".\"users\"\n (\"email\") on update cascade on delete cascade;\n + \ " + type: run_sql