Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Auto refresh team nav data; improve image handling #38

Merged
merged 10 commits into from
Nov 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules
vars.yml
.hokusai-tmp
.google-api-creds.json
prisma/*.db
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"@artsy/next-layout": "^0.2.0",
"@artsy/next-palette": "^1.0.0",
"@prisma/client": "2.11.0",
"@react-hook/window-size": "^3.0.7",
"await-to-js": "^2.1.1",
"aws-sdk": "^2.668.0",
Expand All @@ -40,6 +41,7 @@
"devDependencies": {
"@next/bundle-analyzer": "^10.0.0",
"@now/node": "^1.5.1",
"@prisma/cli": "2.11.0",
"@types/cookie": "^0.3.3",
"@types/csvtojson": "^1.1.5",
"@types/jwt-decode": "^2.2.1",
Expand Down
51 changes: 51 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
Comment on lines +1 to +2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using prisma has been a pretty interesting journey. Their tooling (especially the editor tooling to write these schema files) is top notch. Most things just work, but sometimes it's hard to find out how to do certain things (like removing relations from an entity... use set). I've still been seeing some weird things where there are a ton of processes managing database connections and I haven't quite figured out what I'm doing wrong with that. Otherwise, it works really well.


datasource db {
provider = "sqlite"
url = "file:team.db"
}

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

model Member {
id Int @id @default(autoincrement())
name String @unique
title String
email String @unique
city String?
country String?
floor String?
startDate DateTime
headshot String?
preferredPronouns String?

orgs Organization[]
teams Team[]
subteams Subteam[]

manager Member? @relation("MemberToMember", fields: [managerId], references: [id])
managerId Int?
reports Member[] @relation("MemberToMember")

}

model Organization {
id Int @id @default(autoincrement())
name String @unique
members Member[]
}

model Team {
id Int @id @default(autoincrement())
name String @unique
members Member[]
}

model Subteam {
id Int @id @default(autoincrement())
name String @unique
members Member[]
}
30 changes: 30 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,36 @@
dependencies:
mkdirp "^1.0.4"

"@prisma/bar@0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@prisma/bar/-/bar-0.0.1.tgz#088c4fbbb79c588391437ade9fd3a85527e753b3"
integrity sha512-FVLhwVkbfhXlBhroWfIXMLi+3Jh9IEzYp+9z+MUUiw3ZsbcoAil7CN9/QIjHc4/TcCRyRfuSmT7qCnn4O+TjJw==

"@prisma/cli@2.11.0":
version "2.11.0"
resolved "https://registry.yarnpkg.com/@prisma/cli/-/cli-2.11.0.tgz#34bdc5573ac40edae336b65fa73a164cae437622"
integrity sha512-RphW+1SPrEKgpuE5RFM0mv3BeVTF8MCRIyBt35Z9Z/E4YI30qgEWfZu6VfsNDarHRsFiJRKC73wx/aMQ2rLp4g==
dependencies:
"@prisma/bar" "0.0.1"
"@prisma/engines" "2.11.0-10.58369335532e47bdcec77a2f1e7c1fb83a463918"

"@prisma/client@2.11.0":
version "2.11.0"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.11.0.tgz#574c1aa3b571ea01c0fa8dca348c6ba5db41dcc9"
integrity sha512-BF7K/yi5fAnrt7MelQqUueJyl06IGmIxf+7f5RxFSvyO6xZMbOYxhW21kV2wt10mOIS0khQbo0xY6w/8jViJuQ==
dependencies:
"@prisma/engines-version" "2.11.0-10.58369335532e47bdcec77a2f1e7c1fb83a463918"

"@prisma/engines-version@2.11.0-10.58369335532e47bdcec77a2f1e7c1fb83a463918":
version "2.11.0-10.58369335532e47bdcec77a2f1e7c1fb83a463918"
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-2.11.0-10.58369335532e47bdcec77a2f1e7c1fb83a463918.tgz#840bb5ca8707ed3b852d250c1bac9c75098682ee"
integrity sha512-qlkW4dKoW1dUnperWPuhFriZ/NTHlsKLhBbebxRa8qMuD3o37SvWIDGLjFOQx1N0Eb4H04rI3XxgjkWLFVlZCw==

"@prisma/engines@2.11.0-10.58369335532e47bdcec77a2f1e7c1fb83a463918":
version "2.11.0-10.58369335532e47bdcec77a2f1e7c1fb83a463918"
resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-2.11.0-10.58369335532e47bdcec77a2f1e7c1fb83a463918.tgz#5f02f311ce48297ef3fa9861dcab5ec3e52f1371"
integrity sha512-0WaUybWM7J5zQuG/zYLbV+ZKx9/nzS7Ruu7Y0K2lXJKy3Z9koeVttq+Xt7tVmUX9TLgI1Rwhb9R2e1JMNDWbsw==

"@react-hook/debounce@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@react-hook/debounce/-/debounce-3.0.0.tgz#9eea8b5d81d4cb67cd72dd8657b3ff724afc7cad"
Expand Down