@virtality/schema 0.0.1-alpha.0 → 0.0.1-alpha.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Deploy Prisma Migrations (dev)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- dev
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
deploy:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
env:
|
|
13
|
+
DATABASE_URL: ${{ secrets.DATABASE_URL_DEV }}
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v3
|
|
17
|
+
|
|
18
|
+
- name: Set up Node.js
|
|
19
|
+
uses: actions/setup-node@v3
|
|
20
|
+
with:
|
|
21
|
+
node-version: '18'
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: npm install
|
|
25
|
+
|
|
26
|
+
- name: Run Prisma Migrations
|
|
27
|
+
run: npx prisma migrate deploy
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Deploy Prisma Migrations (main)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
deploy:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
env:
|
|
13
|
+
DATABASE_URL: ${{ secrets.DATABASE_URL_MAIN }}
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v3
|
|
17
|
+
|
|
18
|
+
- name: Set up Node.js
|
|
19
|
+
uses: actions/setup-node@v3
|
|
20
|
+
with:
|
|
21
|
+
node-version: '18'
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: npm install
|
|
25
|
+
|
|
26
|
+
- name: Run Prisma Migrations
|
|
27
|
+
run: npx prisma migrate deploy
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- Added the required column `description` to the `Exercise` table without a default value. This is not possible if the table is not empty.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
-- AlterTable
|
|
8
|
+
ALTER TABLE "Exercise" ADD COLUMN "description" TEXT NOT NULL,
|
|
9
|
+
ADD COLUMN "enabled" BOOLEAN NOT NULL DEFAULT false;
|
package/prisma/schema.prisma
CHANGED
|
@@ -46,6 +46,8 @@ model Exercise {
|
|
|
46
46
|
bodyPart String
|
|
47
47
|
item String?
|
|
48
48
|
image String? @unique
|
|
49
|
+
description String
|
|
50
|
+
enabled Boolean @default(false)
|
|
49
51
|
programExercise ProgramExercise[]
|
|
50
52
|
sessionExercise SessionExercise[]
|
|
51
53
|
}
|
|
@@ -81,24 +83,24 @@ model Organization {
|
|
|
81
83
|
metadata String?
|
|
82
84
|
isActive Boolean? @default(true)
|
|
83
85
|
isFrozen Boolean? @default(false)
|
|
84
|
-
members Member[]
|
|
85
86
|
invitations Invitation[]
|
|
87
|
+
members Member[]
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
model Patient {
|
|
89
|
-
id String @id(map: "patients_pkey")
|
|
90
|
-
userId String?
|
|
91
|
-
name String
|
|
92
|
-
email String?
|
|
93
|
-
phone String?
|
|
94
|
-
dob String?
|
|
95
|
-
sex String?
|
|
96
|
-
weight String?
|
|
97
|
-
height String?
|
|
98
|
-
imageUrl String? @db.VarChar(255)
|
|
99
|
-
avatarId String?
|
|
91
|
+
id String @id(map: "patients_pkey")
|
|
92
|
+
userId String?
|
|
93
|
+
name String
|
|
94
|
+
email String?
|
|
95
|
+
phone String?
|
|
96
|
+
dob String?
|
|
97
|
+
sex String?
|
|
98
|
+
weight String?
|
|
99
|
+
height String?
|
|
100
100
|
createdAt DateTime @default(now()) @db.Timestamp(6)
|
|
101
101
|
updatedAt DateTime @default(now()) @db.Timestamp(6)
|
|
102
|
+
avatarId String?
|
|
103
|
+
image String? @unique
|
|
102
104
|
avatar Avatar? @relation(fields: [avatarId], references: [id])
|
|
103
105
|
patientProgram PatientProgram[]
|
|
104
106
|
}
|
|
@@ -108,10 +110,10 @@ model PatientProgram {
|
|
|
108
110
|
name String
|
|
109
111
|
userId String
|
|
110
112
|
patientId String
|
|
111
|
-
User User @relation(fields: [userId], references: [id])
|
|
112
113
|
Patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
|
|
113
|
-
|
|
114
|
+
User User @relation(fields: [userId], references: [id])
|
|
114
115
|
patientSession PatientSession[]
|
|
116
|
+
programExercise ProgramExercise[]
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
model ProgramExercise {
|
|
@@ -123,8 +125,8 @@ model ProgramExercise {
|
|
|
123
125
|
restTime Int @default(30)
|
|
124
126
|
holdTime Int @default(1)
|
|
125
127
|
speed Float @default(1)
|
|
126
|
-
patientProgram PatientProgram @relation(fields: [programId], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "program_exercises_programId_fkey")
|
|
127
128
|
exercise Exercise @relation(fields: [exerciseId], references: [id])
|
|
129
|
+
patientProgram PatientProgram @relation(fields: [programId], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "program_exercises_programId_fkey")
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
model Session {
|
|
@@ -151,16 +153,16 @@ model User {
|
|
|
151
153
|
updatedAt DateTime @db.Timestamp(6)
|
|
152
154
|
phone String?
|
|
153
155
|
stripeCustomerId String?
|
|
154
|
-
role String? @default("user")
|
|
155
|
-
banned Boolean?
|
|
156
|
-
banReason String?
|
|
157
156
|
banExpires DateTime?
|
|
157
|
+
banReason String?
|
|
158
|
+
banned Boolean?
|
|
159
|
+
role String? @default("user")
|
|
160
|
+
accounts Account[]
|
|
158
161
|
devices Device[]
|
|
162
|
+
invitations Invitation[]
|
|
163
|
+
members Member[]
|
|
159
164
|
patientProgram PatientProgram[]
|
|
160
165
|
sessions Session[]
|
|
161
|
-
accounts Account[]
|
|
162
|
-
members Member[]
|
|
163
|
-
invitations Invitation[]
|
|
164
166
|
}
|
|
165
167
|
|
|
166
168
|
model Verification {
|
|
@@ -204,9 +206,9 @@ model SessionExercise {
|
|
|
204
206
|
restTime Int
|
|
205
207
|
holdTime Int
|
|
206
208
|
speed Float
|
|
207
|
-
patientSession PatientSession @relation(fields: [patientSessionId], references: [id])
|
|
208
|
-
exercise Exercise @relation(fields: [exerciseId], references: [id])
|
|
209
209
|
sessionData SessionData[]
|
|
210
|
+
exercise Exercise @relation(fields: [exerciseId], references: [id])
|
|
211
|
+
patientSession PatientSession @relation(fields: [patientSessionId], references: [id])
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
model SessionData {
|