Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

Commit

Permalink
Added prisma and mysql for form submission
Browse files Browse the repository at this point in the history
  • Loading branch information
BuddyLongLegs committed May 9, 2023
1 parent 496d707 commit 9cfba8f
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import morgan from 'morgan';
import bodyParser from 'body-parser';
import * as dotenv from 'dotenv';
import cors from 'cors'
import {PrismaClient} from '@prisma/client';

dotenv.config();

Expand Down
75 changes: 75 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"description": "Backend for the project SaveMyForm. Backend Less form submission collection for your application",
"main": "app.js",
"dependencies": {
"@prisma/client": "^4.14.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.20.1",
"cors": "^2.8.5",
Expand All @@ -22,6 +23,7 @@
"nodemailer-express-handlebars": "^6.0.0",
"pg": "^8.9.0",
"pg-hstore": "^2.3.4",
"prisma": "^4.14.0",
"sequelize": "^6.28.0",
"uuidv4": "^6.2.13",
"validator": "^13.7.0"
Expand Down
21 changes: 21 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

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

datasource db {
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}

model FormSubmission {
id Int @id @default(autoincrement())
data Json
formId String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
deletedAt DateTime?
}

0 comments on commit 9cfba8f

Please sign in to comment.