Skip to content

Commit

Permalink
fix(workspace): enable connection between docker image and planetscale
Browse files Browse the repository at this point in the history
  • Loading branch information
lauhon committed Jun 16, 2023
1 parent 500e21c commit a4500e5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Setup has only been tested on Apple Silicon M1 Macs. Linux could work but is not
4. [React Native Local Setup](https://reactnative.dev/docs/environment-setup?guide=native) is completed
5. Install `turborepo` globally with `npm i turbo -g`
6. Install yarn globally with `volta install [email protected]`
7. Run `yarn prep` to install node module and setup database
7. For Local Development replace "mysql" with "sqlite" in the `schema.prisma` file
8. Run `yarn prep` to install node module and setup database
On error `xcrun: error: SDK "iphoneos" cannot be located` it may be necessray to run `npx pod-install` in the `mobile` app folder
Expand Down
4 changes: 2 additions & 2 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install Turbo and Prune
FROM amd64/node:16-bullseye-slim AS builder
FROM amd64/node:16 AS builder

WORKDIR /app
RUN yarn global add turbo
Expand Down Expand Up @@ -30,7 +30,7 @@ COPY turbo.json turbo.json
RUN yarn turbo run build --filter=@superlight-labs/api...

# Setup Process and run command
FROM amd64/node:16-bullseye-slim AS runner
FROM amd64/node:16 AS runner
WORKDIR /app

RUN addgroup --system --gid 1001 superlight-api
Expand Down
13 changes: 10 additions & 3 deletions packages/database/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
datasource db {
provider = "sqlite"
provider = "mysql" // "sqlite" for development
url = env("DB_URL")
// relationMode = "prisma"
relationMode = "prisma"
}

generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
engineType = "binary"
}

model User {
Expand All @@ -31,6 +32,8 @@ model ExternalAddress {
updatedAt DateTime @updatedAt
sentTransactions Transaction[] @relation("sentTransactions")
recievedTransactions Transaction[] @relation("recievedTransactions")
@@index([userEmail])
}

model Transaction {
Expand All @@ -42,6 +45,9 @@ model Transaction {
sender ExternalAddress @relation(name: "sentTransactions", fields: [senderAddress], references: [address])
senderAddress String
note String?
@@index([recieverAddress])
@@index([senderAddress])
}

model MpcKeyShare {
Expand All @@ -57,4 +63,5 @@ model MpcKeyShare {
updatedAt DateTime @updatedAt
@@unique([userId, path])
@@index([userId, userDevicePublicKey])
}

0 comments on commit a4500e5

Please sign in to comment.