Skip to content

Commit

Permalink
Merge pull request #131 from databrary/hasura_migration
Browse files Browse the repository at this point in the history
Update Hasura's column names to camelCase and Upgrade client's Apollo
  • Loading branch information
TheoWolf authored Sep 14, 2020
2 parents 426d6fe + 4681c38 commit f96bf3f
Show file tree
Hide file tree
Showing 164 changed files with 230 additions and 2,558 deletions.
35 changes: 1 addition & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,41 +63,8 @@ upgrade-hasura-cli:
##############################################################################
# Hasura
##############################################################################
HASURA_IMAGE=hasura-cli
HASURA_DIR=./docker-assets/$(HASURA_IMAGE)

check-image-hasura-cli: FORCE
@if [ -z "$$(docker images -q $(HASURA_IMAGE):latest 2> /dev/null)" ]; then\
touch $(HASURA_DIR)/Dockerfile;\
fi

$(HASURA_DIR): $(HASURA_DIR)/Dockerfile
@docker build -t $(HASURA_IMAGE) $(HASURA_DIR)/
@touch $@

setup_migrations: check-image-minio-cli $(HASURA_DIR)
@docker run\
--env-file=./.env\
--network="host"\
-v ${CURDIR}/hasura:/hasura\
-it ${HASURA_IMAGE}\
migrate apply --skip-update-check
@docker run\
--env-file=./.env\
--network="host"\
-v ${CURDIR}/hasura:/hasura\
-it ${HASURA_IMAGE}\
metadata apply --skip-update-check

migrate: setup_migrations
migrate:
cd hasura && hasura console && cd ..
# Problem with console running in docker :P
# docker run\
# --env-file=./.env\
# --network="host"\
# -v ${CURDIR}/hasura:/hasura\
# -it ${HASURA_IMAGE}\
# console --skip-update-check --no-browser --console-port 9695

##############################################################################
# Minio
Expand Down
11 changes: 4 additions & 7 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"build:pwa": "quasar build -m pwa"
},
"dependencies": {
"@apollo/client": "^3.1.5",
"@quasar/extras": "^1.8.2",
"@uppy/aws-s3": "^1.6.2",
"@uppy/aws-s3-multipart": "^1.6.2",
Expand All @@ -24,18 +25,14 @@
"@uppy/instagram": "^1.4.3",
"@uppy/url": "^1.5.3",
"@uppy/webcam": "^1.6.3",
"apollo-cache-inmemory": "^1.6.5",
"apollo-client": "^2.6.8",
"apollo-link": "^1.2.13",
"apollo-link-context": "^1.0.19",
"apollo-link-http": "^1.5.16",
"axios": "^0.18.1",
"graphql": "^14.5.8",
"graphql-tag": "^2.10.1",
"fs-extra": "^9.0.1",
"graphql": "^15.3.0",
"js-cookie": "^2.2.1",
"node-fetch": "^2.6.0",
"node-sass": "^4.13.1",
"quasar": "^1.12.12",
"react": "^16.13.1",
"v-runtime-template": "^1.10.0",
"validator": "^13.0.0",
"vue-apollo": "^3.0.2",
Expand Down
4 changes: 1 addition & 3 deletions client/src/boot/apollo.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { ApolloClient } from 'apollo-client'
import { InMemoryCache } from 'apollo-cache-inmemory'
import { ApolloClient, InMemoryCache, createHttpLink } from '@apollo/client'
import VueApollo from 'vue-apollo'
import fetch from 'node-fetch'
import { createHttpLink } from 'apollo-link-http'

export default async ({ app, Vue }) => {
const httpLink = createHttpLink({
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/FileExplorer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ export default {
query GetProject($projectId: Int!) {
assets(where: {
id: {_eq: $projectId},
type_id: {_eq: 1}
typeId: {_eq: 1}
}) {
name
datetime_created
datetimeCreated
}
}
`,
Expand Down
6 changes: 3 additions & 3 deletions client/src/graphql/createProject.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag'
import { gql } from '@apollo/client'

export default function createProject (name) {
return {
Expand All @@ -7,8 +7,8 @@ export default function createProject (name) {
insert_assets(
objects: {
name: $name,
asset_type: project,
privacy_type: private
assetType: project,
privacyType: private
}
) {
returning {
Expand Down
6 changes: 3 additions & 3 deletions client/src/pages/Landing/LandingLoggedIn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ export default {
query: gql`
query GetProjectsByUserId($userId: Int!) {
assets(
where: {asset_type: {_eq: project}, _and: {created_by_id: {_eq: $userId}}}
order_by: {datetime_created: desc}
where: {assetType: {_eq: project}, _and: {createdById: {_eq: $userId}}}
order_by: {datetimeCreated: desc}
) {
id
name
datetime_created
datetimeCreated
}
}
`,
Expand Down
6 changes: 3 additions & 3 deletions client/src/pages/Project/Landing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ export default {
query GetProject($projectId: Int!) {
assets(where: {
id: {_eq: $projectId},
asset_type: {_eq: project}
assetType: {_eq: project}
}) {
id
asset_type
assetType
name
datetime_created
datetimeCreated
}
}
`,
Expand Down
Loading

0 comments on commit f96bf3f

Please sign in to comment.