Skip to content

Commit

Permalink
Upgrade prisma and related codes
Browse files Browse the repository at this point in the history
  • Loading branch information
threedalpeng committed Feb 24, 2021
1 parent 3243ee2 commit f7690bd
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 40 deletions.
5 changes: 3 additions & 2 deletions backend/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
yarn prisma migrate deploy --preview-feature
yarn prisma db push --preview-feature
yarn prisma db seed --preview-feature
yarn start
yarn prisma generate
yarn start
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "eslint --ext .js ."
},
"dependencies": {
"@prisma/client": "^2.15.0",
"@prisma/client": "^2.17.0",
"bcryptjs": "^2.4.3",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
Expand All @@ -20,12 +20,12 @@
"morgan": "^1.10.0",
"multer": "^1.4.2",
"nodemailer": "^6.4.18",
"prisma": "^2.17.0",
"sharp": "^0.27.1",
"validator": "^13.5.2",
"web-vitals": "^1.1.0"
},
"devDependencies": {
"@prisma/cli": "2.15.0",
"eslint": "^7.18.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^7.2.0",
Expand Down
13 changes: 6 additions & 7 deletions backend/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
generator client {
provider = "prisma-client-js"
previewFeatures = ["nativeTypes"]
provider = "prisma-client-js"
}

datasource db {
Expand Down Expand Up @@ -48,9 +47,9 @@ model Note {
}

model Event {
id Int @id @default(autoincrement())
title String
startDate DateTime
endDate DateTime
allDay Boolean? @default(false)
id Int @id @default(autoincrement())
title String
start DateTime
end DateTime
allDay Boolean? @default(false)
}
17 changes: 8 additions & 9 deletions backend/prisma/seed.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { Status } = require('@prisma/client');
const prisma = require('../lib/prisma');

async function main() {
Expand All @@ -15,7 +14,7 @@ async function main() {
codeforcesHandle: 'codeforcesMaster',
class: 'Advanced',
role: 'Admin',
status: 'ACCEPTED'
status: 'ACCEPTED',
},
});
const student = await prisma.user.upsert({
Expand All @@ -31,7 +30,7 @@ async function main() {
codeforcesHandle: 'codeforcesMaster',
class: 'Advanced',
role: 'Student',
status: 'ACCEPTED'
status: 'ACCEPTED',
},
});
const post1 = await prisma.note.create({
Expand All @@ -55,23 +54,23 @@ async function main() {
console.log({ admin, student, post1, post2 });
const event1 = await prisma.event.create({
data: {
startDate: new Date(),
endDate: new Date(),
start: new Date(),
end: new Date(),
title: 'Today',
allDay: true,
},
});
const event2 = await prisma.event.create({
data: {
startDate: new Date(2021, 0, 22),
endDate: new Date(2021, 1, 2),
start: new Date(2021, 0, 22),
end: new Date(2021, 1, 2),
title: 'Some Event',
},
});
const event3 = await prisma.event.create({
data: {
startDate: new Date(2021, 1, 15, 9),
endDate: new Date(2021, 1, 16, 9),
start: new Date(2021, 1, 15, 9),
end: new Date(2021, 1, 16, 9),
title: 'Another Event',
},
});
Expand Down
40 changes: 20 additions & 20 deletions backend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,22 @@
minimatch "^3.0.4"
strip-json-comments "^3.1.1"

"@prisma/[email protected].0":
version "2.15.0"
resolved "https://registry.yarnpkg.com/@prisma/cli/-/cli-2.15.0.tgz#a979a67dbd606a966cf475686170128562590713"
integrity sha512-sF2mgn5oH5fL9/CKxS0tqojf0rK2BKODlEUqL+2s3YZqvJRSt4iFpiyjgajyd0wyTyv1k9LDHTV0yOD1mXDBsA==
"@prisma/client@^2.17.0":
version "2.17.0"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.17.0.tgz#e38462796c2e824504763416f5e3a7219d70652d"
integrity sha512-tzsBxtx9J1epOGCiBeXur1tEz81UIdWg2G/HpDmflXKcv/MJb+KCWSKSsEW49eXcvVwRgxNyxLoCO6CwvjQKcg==
dependencies:
"@prisma/engines" "2.15.0-25.e51dc3b5a9ee790a07104bec1c9477d51740fe54"
"@prisma/engines-version" "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223"

"@prisma/client@^2.15.0":
version "2.16.1"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.16.1.tgz#3aed1506f4090734735d1036bfdaee997032e793"
integrity sha512-g4zXwC9PRtlrad/CBu+lXHRhvkEz4QW9tDn7bJGwCVNeLi+gLzSbEHjo3xLZgI3+Jp+40flOzrJrYP0bkNCpdQ==
dependencies:
"@prisma/engines-version" "2.16.1-1.8b74ad57aaf2cc6c155f382a18a8e3ba95aceb03"

"@prisma/engines-version@2.16.1-1.8b74ad57aaf2cc6c155f382a18a8e3ba95aceb03":
version "2.16.1-1.8b74ad57aaf2cc6c155f382a18a8e3ba95aceb03"
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-2.16.1-1.8b74ad57aaf2cc6c155f382a18a8e3ba95aceb03.tgz#52c026a05f6c109dd642c1edcc60ca45b01021ca"
integrity sha512-BkqxSWOc9aNYXjtmRtaLy2fKIeJ3+NKimRL1gKWXMjtxhKS5E3wvyxwZamtfIpEaZELGAO3x5+gqwoR9kS2oZA==
"@prisma/engines-version@2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223":
version "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223"
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223.tgz#9ae6ed4467a0febff8afaf216c1bb67225f51b84"
integrity sha512-9idv5blqPUlvUPVT48eVi3T0RS/NBklUcjrla3jWyV8AYfB2BdaG/Zci7H5ajyYLnfZZHG9tBpP0LcveQCFH8A==

"@prisma/engines@2.15.0-25.e51dc3b5a9ee790a07104bec1c9477d51740fe54":
version "2.15.0-25.e51dc3b5a9ee790a07104bec1c9477d51740fe54"
resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-2.15.0-25.e51dc3b5a9ee790a07104bec1c9477d51740fe54.tgz#3093ace7c09cf694214727c4e67109f2a2d8855a"
integrity sha512-AgPxAWtwYhhTNEEsV4lK63HTe9z0GAGL3ofMr2B0TncACmzi9lhdun9TTNie38Oy/3DLfr71TUHKUpV8QjOKUw==
"@prisma/engines@2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223":
version "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223"
resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223.tgz#08bc3633fd27fb1935805ef16c37802ed713db5b"
integrity sha512-FKjVD6NYbGiQhwas3hA2uMpNchz+Mf3tv5qA8Ci9cAkKHGqt3jWjjUAK9juVBqeOcv4OPimQYMrkRX6SvaxBjg==

"@sindresorhus/is@^0.14.0":
version "0.14.0"
Expand Down Expand Up @@ -1765,6 +1758,13 @@ prettier@^2.2.1:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==

prisma@^2.17.0:
version "2.17.0"
resolved "https://registry.yarnpkg.com/prisma/-/prisma-2.17.0.tgz#686469914ed13d4b0926ee5f17efb7a9ab741e8a"
integrity sha512-NypJI7OCXCfDkRKubbVb3nmPeRJ1SjQfg6QAwK06KsreBZl1F96rFz2iB2bl4kIrhLAbIySBjwUJlG87Jsxt7g==
dependencies:
"@prisma/engines" "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223"

process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
Expand Down

0 comments on commit f7690bd

Please sign in to comment.