{
+ return (
+
+ {
+ console.log(value);
+ }}
+ enterButton
+ />
+
+
-
- );
- }}
- size="small"
- pagination={{ position: "top" }}
- columns={columns.map(item => ({ ...item }))}
- rowKey="id"
- dataSource={data && data.available_jobs}
- onChange={handleTableChange}
- />
+ }}
+ >
+ Delete All
+
+
+ );
+ }}
+ size="small"
+ pagination={{ position: "top" }}
+ columns={columns.map(item => ({ ...item }))}
+ rowKey="id"
+ dataSource={data && data.available_jobs}
+ onChange={handleTableChange}
+ />
+
);
}
diff --git a/client/src/components/jobs-available-new/jobs-available-new.container.jsx b/client/src/components/jobs-available-new/jobs-available-new.container.jsx
index 7f0de5e68..371c486ee 100644
--- a/client/src/components/jobs-available-new/jobs-available-new.container.jsx
+++ b/client/src/components/jobs-available-new/jobs-available-new.container.jsx
@@ -1,19 +1,20 @@
import React from "react";
-import { useQuery, useMutation } from "react-apollo";
+import { useMutation, useQuery } from "react-apollo";
import {
- QUERY_AVAILABLE_NEW_JOBS,
- DELETE_AVAILABLE_JOB,
- DELETE_ALL_AVAILABLE_NEW_JOBS
+ DELETE_ALL_AVAILABLE_NEW_JOBS,
+ QUERY_AVAILABLE_NEW_JOBS
} from "../../graphql/available-jobs.queries";
+import { INSERT_NEW_JOB } from "../../graphql/jobs.queries";
import AlertComponent from "../alert/alert.component";
import JobsAvailableComponent from "./jobs-available-new.component";
-export default function JobsAvailableContainer() {
+export default function JobsAvailableContainer({ deleteJob, estDataLazyLoad }) {
const { loading, error, data, refetch } = useQuery(QUERY_AVAILABLE_NEW_JOBS, {
fetchPolicy: "network-only"
});
- const [deleteJob] = useMutation(DELETE_AVAILABLE_JOB);
+
const [deleteAllNewJobs] = useMutation(DELETE_ALL_AVAILABLE_NEW_JOBS);
+ const [insertNewJob] = useMutation(INSERT_NEW_JOB);
if (error) return ;
return (
@@ -23,6 +24,8 @@ export default function JobsAvailableContainer() {
refetch={refetch}
deleteJob={deleteJob}
deleteAllNewJobs={deleteAllNewJobs}
+ insertNewJob={insertNewJob}
+ estDataLazyLoad={estDataLazyLoad}
/>
);
}
diff --git a/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx b/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx
index f5e5d9793..a6c44f5df 100644
--- a/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx
+++ b/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx
@@ -8,7 +8,8 @@ export default function JobsAvailableSupplementComponent({
data,
refetch,
deleteJob,
- deleteAllNewJobs
+ deleteAllNewJobs,
+ estDataLazyLoad
}) {
const { t } = useTranslation();
diff --git a/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx b/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx
index 661edbfb0..306ba3a3d 100644
--- a/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx
+++ b/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx
@@ -1,21 +1,19 @@
import React from "react";
-import { useQuery, useMutation } from "react-apollo";
-import {
- QUERY_AVAILABLE_SUPPLEMENT_JOBS,
- DELETE_AVAILABLE_JOB,
- DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS
-} from "../../graphql/available-jobs.queries";
+import { useMutation, useQuery } from "react-apollo";
+import { DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS, QUERY_AVAILABLE_SUPPLEMENT_JOBS } from "../../graphql/available-jobs.queries";
import AlertComponent from "../alert/alert.component";
import JobsAvailableSupplementComponent from "./jobs-available-supplement.component";
-export default function JobsAvailableSupplementContainer() {
+export default function JobsAvailableSupplementContainer({
+ deleteJob,
+ estDataLazyLoad
+}) {
const { loading, error, data, refetch } = useQuery(
QUERY_AVAILABLE_SUPPLEMENT_JOBS,
{
fetchPolicy: "network-only"
}
);
- const [deleteJob] = useMutation(DELETE_AVAILABLE_JOB);
const [deleteAllNewJobs] = useMutation(DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS);
if (error) return ;
@@ -26,6 +24,7 @@ export default function JobsAvailableSupplementContainer() {
refetch={refetch}
deleteJob={deleteJob}
deleteAllNewJobs={deleteAllNewJobs}
+ estDataLazyLoad={estDataLazyLoad}
/>
);
}
diff --git a/client/src/components/owner-find-modal/owner-find-modal.component.jsx b/client/src/components/owner-find-modal/owner-find-modal.component.jsx
new file mode 100644
index 000000000..59b189772
--- /dev/null
+++ b/client/src/components/owner-find-modal/owner-find-modal.component.jsx
@@ -0,0 +1,4 @@
+import React from "react";
+export default function OwnerFindModalComponent() {
+ return Modal Componnentasdasd
;
+}
diff --git a/client/src/components/owner-find-modal/owner-find-modal.container.jsx b/client/src/components/owner-find-modal/owner-find-modal.container.jsx
new file mode 100644
index 000000000..60b7625c2
--- /dev/null
+++ b/client/src/components/owner-find-modal/owner-find-modal.container.jsx
@@ -0,0 +1,23 @@
+import React from "react";
+import { Modal } from "antd";
+import OwnerFindModalComponent from "./owner-find-modal.component";
+import LoadingSpinner from "../loading-spinner/loading-spinner.component";
+import AlertComponent from "../alert/alert.component";
+import { json } from "body-parser";
+
+export default function OwnerFindModalContainer({
+ loading,
+ error,
+ owner,
+ ...modalProps
+}) {
+ //use owner object to run query and find what possible owners there are.
+ return (
+
+ {loading ? : null}
+ {error ? : null}
+ {owner ? : null}
+ {owner ? JSON.stringify(owner) : null}
+
+ );
+}
diff --git a/client/src/graphql/apollo-error-handling.js b/client/src/graphql/apollo-error-handling.js
index 6b5b74677..4c232958a 100644
--- a/client/src/graphql/apollo-error-handling.js
+++ b/client/src/graphql/apollo-error-handling.js
@@ -4,7 +4,6 @@ import { auth } from "../firebase/firebase.utils";
//https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth
const errorLink = onError(
({ graphQLErrors, networkError, operation, forward }) => {
- let access_token = window.localStorage.getItem("token");
// console.log("graphQLErrors", graphQLErrors);
// console.log("networkError", networkError);
// console.log("operation", operation);
@@ -26,59 +25,59 @@ const errorLink = onError(
//User access token has expired
//props.history.push("/network-error");
console.log("We need a new token!");
- if (access_token && access_token !== "undefined") {
- // Let's refresh token through async request
+ // Let's refresh token through async request
- auth.currentUser.getIdToken(true).then(token => {
- if (token) {
- window.localStorage.setItem("token", token);
- operation.setContext(({ headers = {} }) => ({
- headers: {
- ...headers,
- authorization: token ? `Bearer ${token}` : ""
- }
- }));
- return forward(operation);
- }
- });
+ auth.currentUser.getIdToken(true).then(token => {
+ if (token) {
+ console.log("Got the new token.", token);
+ window.localStorage.setItem("token", token);
+ operation.setContext(({ headers = {} }) => ({
+ headers: {
+ ...headers,
+ authorization: token ? `Bearer ${token}` : ""
+ }
+ }));
+ console.log("Forwarding operation", operation);
+ return forward(operation);
+ }
+ });
- // 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);
+ // 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}` : ""
- // }
- // }));
+ // // 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);
- // });
- // });
- }
+ // 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);
+ // });
+ // });
}
}
);
diff --git a/client/src/graphql/available-jobs.queries.js b/client/src/graphql/available-jobs.queries.js
index de5c5469c..cd23481fd 100644
--- a/client/src/graphql/available-jobs.queries.js
+++ b/client/src/graphql/available-jobs.queries.js
@@ -70,3 +70,12 @@ export const DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS = gql`
}
}
`;
+
+export const QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK = gql`
+ query QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK($id: uuid!) {
+ available_jobs_by_pk(id: $id) {
+ id
+ est_data
+ }
+ }
+`;
diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js
index 6fe497459..2a69f727d 100644
--- a/client/src/graphql/jobs.queries.js
+++ b/client/src/graphql/jobs.queries.js
@@ -250,3 +250,13 @@ export const CONVERT_JOB_TO_RO = gql`
}
}
`;
+
+export const INSERT_NEW_JOB = gql`
+ mutation INSERT_JOB($job: [jobs_insert_input!]!) {
+ insert_jobs(objects: $job) {
+ returning {
+ id
+ }
+ }
+ }
+`;
diff --git a/client/src/pages/jobs-available/jobs-available.page.component.jsx b/client/src/pages/jobs-available/jobs-available.page.component.jsx
index 7afa216f4..e52fedf55 100644
--- a/client/src/pages/jobs-available/jobs-available.page.component.jsx
+++ b/client/src/pages/jobs-available/jobs-available.page.component.jsx
@@ -2,12 +2,22 @@ import React from "react";
import JobsAvailableContainer from "../../components/jobs-available-new/jobs-available-new.container";
import JobsAvailableSupplementContainer from "../../components/jobs-available-supplement/jobs-available-supplement.container";
-export default function JobsAvailablePageComponent() {
+export default function JobsAvailablePageComponent({
+ deleteJob,
+ estDataLazyLoad
+}) {
return (
-
-
-
+ Available New Jobs
+
+ Available Supplements
+
);
}
diff --git a/client/src/pages/jobs-available/jobs-available.page.container.jsx b/client/src/pages/jobs-available/jobs-available.page.container.jsx
index 6a146ea6a..9dc54c321 100644
--- a/client/src/pages/jobs-available/jobs-available.page.container.jsx
+++ b/client/src/pages/jobs-available/jobs-available.page.container.jsx
@@ -1,10 +1,26 @@
-import React from 'react'
-import JobsAvailablePageComponent from './jobs-available.page.component'
+import React from "react";
+import { useMutation, useLazyQuery } from "react-apollo";
+import {
+ DELETE_AVAILABLE_JOB,
+ QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK
+} from "../../graphql/available-jobs.queries";
+import JobsAvailablePageComponent from "./jobs-available.page.component";
export default function JobsAvailablePageContainer() {
- return (
-
-
-
- )
+ const [deleteJob] = useMutation(DELETE_AVAILABLE_JOB);
+
+ const estDataLazyLoad = useLazyQuery(
+ QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK,
+ {
+ fetchPolicy: "network-only"
+ }
+ );
+ return (
+
+
+
+ );
}
diff --git a/client/src/setupTest.js b/client/src/setupTests.js
similarity index 67%
rename from client/src/setupTest.js
rename to client/src/setupTests.js
index 82edfc9e5..de7049700 100644
--- a/client/src/setupTest.js
+++ b/client/src/setupTests.js
@@ -1,4 +1,3 @@
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
-
-configure({ adapter: new Adapter() });
+configure({ adapter: new Adapter() });
\ No newline at end of file
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 345a74077..ba488efd7 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -151,6 +151,7 @@
"successes": {
"all_deleted": "{{count}} jobs deleted successfully.",
"converted": "Job converted successfully.",
+ "created": "Job created successfully.",
"deleted": "Job deleted successfully.",
"save": "Record Saved",
"savetitle": "Record saved successfully."
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 2a5f5e741..07906a589 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -151,6 +151,7 @@
"successes": {
"all_deleted": "{{count}} trabajos eliminados con éxito.",
"converted": "Trabajo convertido con éxito.",
+ "created": "Trabajo creado con éxito.",
"deleted": "Trabajo eliminado con éxito.",
"save": "Registro guardado",
"savetitle": "Registro guardado con éxito."
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index 48558307f..1654f2ad9 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -151,6 +151,7 @@
"successes": {
"all_deleted": "{{count}} travaux supprimés avec succès.",
"converted": "Travail converti avec succès.",
+ "created": "Le travail a été créé avec succès.",
"deleted": "Le travail a bien été supprimé.",
"save": "Enregistrement enregistré",
"savetitle": "Enregistrement enregistré avec succès."
diff --git a/client/yarn.lock b/client/yarn.lock
index 87f7832b9..d73e081cd 100644
--- a/client/yarn.lock
+++ b/client/yarn.lock
@@ -79,6 +79,15 @@
"@apollo/react-hooks" "^3.1.3"
tslib "^1.10.0"
+"@apollo/react-testing@^3.1.3":
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/@apollo/react-testing/-/react-testing-3.1.3.tgz#d8dd318f58fb6a404976bfa3f8a79e976a5c6562"
+ integrity sha512-58R7gROl4TZMHm5kS76Nof9FfZhD703AU3SmJTA2f7naiMqC9Qd8pZ4oNCBafcab0SYN//UtWvLcluK5O7V/9g==
+ dependencies:
+ "@apollo/react-common" "^3.1.3"
+ fast-json-stable-stringify "^2.0.0"
+ tslib "^1.10.0"
+
"@babel/code-frame@7.5.5", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5":
version "7.5.5"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d"
@@ -11051,6 +11060,8 @@ rxjs@^6.4.0, rxjs@^6.5.3:
version "6.5.4"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c"
integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==
+ dependencies:
+ tslib "^1.9.0"
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
diff --git a/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/down.yaml b/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/down.yaml
new file mode 100644
index 000000000..87a64b81f
--- /dev/null
+++ b/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."first_name" IS E'null'
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "ownr_fn" to "first_name";
+ type: run_sql
diff --git a/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/up.yaml b/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/up.yaml
new file mode 100644
index 000000000..c593c078b
--- /dev/null
+++ b/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/up.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."first_name" IS E''
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "first_name" to "ownr_fn";
+ type: run_sql
diff --git a/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/down.yaml b/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/down.yaml
new file mode 100644
index 000000000..40b47b5cb
--- /dev/null
+++ b/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."last_name" IS E'null'
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "ownr_ln" to "last_name";
+ type: run_sql
diff --git a/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/up.yaml b/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/up.yaml
new file mode 100644
index 000000000..c32e1b096
--- /dev/null
+++ b/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/up.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."last_name" IS E''
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "last_name" to "ownr_ln";
+ type: run_sql
diff --git a/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/down.yaml b/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/down.yaml
new file mode 100644
index 000000000..91f18eab1
--- /dev/null
+++ b/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."address1" IS E'null'
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "ownr_addr1" to "address1";
+ type: run_sql
diff --git a/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/up.yaml b/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/up.yaml
new file mode 100644
index 000000000..0224619e8
--- /dev/null
+++ b/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/up.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."address1" IS E''
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "address1" to "ownr_addr1";
+ type: run_sql
diff --git a/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/down.yaml b/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/down.yaml
new file mode 100644
index 000000000..a25f8b213
--- /dev/null
+++ b/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."address2" IS E'null'
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "ownr_addr2" to "address2";
+ type: run_sql
diff --git a/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/up.yaml b/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/up.yaml
new file mode 100644
index 000000000..fc5367abd
--- /dev/null
+++ b/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/up.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."address2" IS E''
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "address2" to "ownr_addr2";
+ type: run_sql
diff --git a/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/down.yaml b/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/down.yaml
new file mode 100644
index 000000000..410b346dd
--- /dev/null
+++ b/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."city" IS E'null'
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "ownr_city" to "city";
+ type: run_sql
diff --git a/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/up.yaml b/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/up.yaml
new file mode 100644
index 000000000..81bf2fdcf
--- /dev/null
+++ b/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/up.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."city" IS E''
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "city" to "ownr_city";
+ type: run_sql
diff --git a/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/down.yaml b/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/down.yaml
new file mode 100644
index 000000000..5c2d9fe32
--- /dev/null
+++ b/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."state" IS E'null'
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "ownr_st" to "state";
+ type: run_sql
diff --git a/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/up.yaml b/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/up.yaml
new file mode 100644
index 000000000..c3499e5e1
--- /dev/null
+++ b/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/up.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."state" IS E''
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "state" to "ownr_st";
+ type: run_sql
diff --git a/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/down.yaml b/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/down.yaml
new file mode 100644
index 000000000..55aeb38f1
--- /dev/null
+++ b/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."zip" IS E'null'
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "ownr_zip" to "zip";
+ type: run_sql
diff --git a/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/up.yaml b/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/up.yaml
new file mode 100644
index 000000000..c2f32b926
--- /dev/null
+++ b/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/up.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."zip" IS E''
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "zip" to "ownr_zip";
+ type: run_sql
diff --git a/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/down.yaml b/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/down.yaml
new file mode 100644
index 000000000..a36da5733
--- /dev/null
+++ b/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."country" IS E'null'
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "ownr_ctry" to "country";
+ type: run_sql
diff --git a/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/up.yaml b/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/up.yaml
new file mode 100644
index 000000000..17ba0867f
--- /dev/null
+++ b/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/up.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."country" IS E''
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "country" to "ownr_ctry";
+ type: run_sql
diff --git a/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/down.yaml b/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/down.yaml
new file mode 100644
index 000000000..dc998c0d2
--- /dev/null
+++ b/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."email" IS E'null'
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "ownr_ea" to "email";
+ type: run_sql
diff --git a/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/up.yaml b/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/up.yaml
new file mode 100644
index 000000000..045b0b101
--- /dev/null
+++ b/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/up.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."email" IS E''
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "email" to "ownr_ea";
+ type: run_sql
diff --git a/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/down.yaml b/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/down.yaml
new file mode 100644
index 000000000..4e4b328cc
--- /dev/null
+++ b/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."phone" IS E'null'
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "ownr_ph1" to "phone";
+ type: run_sql
diff --git a/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/up.yaml b/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/up.yaml
new file mode 100644
index 000000000..28ad46d6e
--- /dev/null
+++ b/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/up.yaml
@@ -0,0 +1,6 @@
+- args:
+ sql: COMMENT ON COLUMN "public"."owners"."phone" IS E''
+ type: run_sql
+- args:
+ sql: alter table "public"."owners" rename column "phone" to "ownr_ph1";
+ type: run_sql
diff --git a/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/down.yaml b/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/down.yaml
new file mode 100644
index 000000000..323204856
--- /dev/null
+++ b/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/down.yaml
@@ -0,0 +1,3 @@
+- args:
+ sql: ALTER TABLE "public"."owners" DROP COLUMN "ownr_ph2";
+ type: run_sql
diff --git a/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/up.yaml b/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/up.yaml
new file mode 100644
index 000000000..41e34c325
--- /dev/null
+++ b/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/up.yaml
@@ -0,0 +1,3 @@
+- args:
+ sql: ALTER TABLE "public"."owners" ADD COLUMN "ownr_ph2" text NULL;
+ type: run_sql
diff --git a/hasura/migrations/1580319295873_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580319295873_update_permission_user_public_table_owners/down.yaml
new file mode 100644
index 000000000..f2f87a705
--- /dev/null
+++ b/hasura/migrations/1580319295873_update_permission_user_public_table_owners/down.yaml
@@ -0,0 +1,43 @@
+- args:
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: drop_insert_permission
+- args:
+ permission:
+ check:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ columns:
+ - allow_text_message
+ - ownr_addr1
+ - ownr_addr2
+ - ownr_city
+ - ownr_ctry
+ - ownr_ea
+ - ownr_fn
+ - ownr_ln
+ - ownr_ph1
+ - preferred_contact
+ - ownr_st
+ - ownr_zip
+ - created_at
+ - updated_at
+ - id
+ - shopid
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: create_insert_permission
diff --git a/hasura/migrations/1580319295873_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580319295873_update_permission_user_public_table_owners/up.yaml
new file mode 100644
index 000000000..699ba86d6
--- /dev/null
+++ b/hasura/migrations/1580319295873_update_permission_user_public_table_owners/up.yaml
@@ -0,0 +1,44 @@
+- args:
+ role: user
+ table:
+ name: owners
+ 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
+ - ownr_fn
+ - ownr_ln
+ - ownr_addr1
+ - ownr_addr2
+ - ownr_city
+ - ownr_st
+ - ownr_zip
+ - ownr_ctry
+ - ownr_ea
+ - ownr_ph1
+ - preferred_contact
+ - allow_text_message
+ - shopid
+ - ownr_ph2
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: create_insert_permission
diff --git a/hasura/migrations/1580319301454_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580319301454_update_permission_user_public_table_owners/down.yaml
new file mode 100644
index 000000000..e37bbfa01
--- /dev/null
+++ b/hasura/migrations/1580319301454_update_permission_user_public_table_owners/down.yaml
@@ -0,0 +1,41 @@
+- args:
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: drop_select_permission
+- args:
+ permission:
+ allow_aggregations: false
+ columns:
+ - id
+ - created_at
+ - updated_at
+ - ownr_fn
+ - ownr_ln
+ - ownr_addr1
+ - ownr_addr2
+ - ownr_city
+ - ownr_st
+ - ownr_zip
+ - ownr_ctry
+ - ownr_ea
+ - ownr_ph1
+ - preferred_contact
+ - allow_text_message
+ - shopid
+ computed_fields: []
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: create_select_permission
diff --git a/hasura/migrations/1580319301454_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580319301454_update_permission_user_public_table_owners/up.yaml
new file mode 100644
index 000000000..979378d18
--- /dev/null
+++ b/hasura/migrations/1580319301454_update_permission_user_public_table_owners/up.yaml
@@ -0,0 +1,42 @@
+- args:
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: drop_select_permission
+- args:
+ permission:
+ allow_aggregations: false
+ columns:
+ - allow_text_message
+ - ownr_addr1
+ - ownr_addr2
+ - ownr_city
+ - ownr_ctry
+ - ownr_ea
+ - ownr_fn
+ - ownr_ln
+ - ownr_ph1
+ - ownr_ph2
+ - ownr_st
+ - ownr_zip
+ - preferred_contact
+ - created_at
+ - updated_at
+ - id
+ - shopid
+ computed_fields: []
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: create_select_permission
diff --git a/hasura/migrations/1580319306963_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580319306963_update_permission_user_public_table_owners/down.yaml
new file mode 100644
index 000000000..d61f0c925
--- /dev/null
+++ b/hasura/migrations/1580319306963_update_permission_user_public_table_owners/down.yaml
@@ -0,0 +1,42 @@
+- args:
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: drop_update_permission
+- args:
+ permission:
+ columns:
+ - ownr_addr1
+ - ownr_addr2
+ - allow_text_message
+ - ownr_city
+ - ownr_ctry
+ - created_at
+ - ownr_ea
+ - ownr_fn
+ - ownr_ln
+ - ownr_ph1
+ - preferred_contact
+ - shopid
+ - ownr_st
+ - updated_at
+ - ownr_zip
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: create_update_permission
diff --git a/hasura/migrations/1580319306963_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580319306963_update_permission_user_public_table_owners/up.yaml
new file mode 100644
index 000000000..8aa9459b9
--- /dev/null
+++ b/hasura/migrations/1580319306963_update_permission_user_public_table_owners/up.yaml
@@ -0,0 +1,44 @@
+- args:
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: drop_update_permission
+- args:
+ permission:
+ columns:
+ - allow_text_message
+ - ownr_addr1
+ - ownr_addr2
+ - ownr_city
+ - ownr_ctry
+ - ownr_ea
+ - ownr_fn
+ - ownr_ln
+ - ownr_ph1
+ - ownr_ph2
+ - ownr_st
+ - ownr_zip
+ - preferred_contact
+ - created_at
+ - updated_at
+ - id
+ - shopid
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: user
+ table:
+ name: owners
+ schema: public
+ type: create_update_permission