Skip to content

Commit 907345b

Browse files
anishsapkotaOhKai
andauthored
Ms2/read me db commands update (#443)
* updated readme.md * minor refCounter bug fix * fix: readme --------- Co-authored-by: Kai Rohwer <[email protected]>
1 parent 878af1f commit 907345b

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ When you have started the development code of the Management System, the first i
7575

7676
Both users actually have the same privileges by default, but the first one logging in can see the _System Dashboard_ and becomes the _System Admin_.
7777

78+
**Local Development with DB : Helper commands** \
79+
`yarn dev-ms-db` : starts the docker container and setups the default db \
80+
`yarn dev-ms-db-create`: create a new branch specific database \
81+
`yarn dev-ms-db-use <branch | default>`: switch between dbs, also creates a branch db if not created already \
82+
`yarn dev-ms-db-delete <--all | --branch <branch-name> >` : delete db \
83+
`yarn dev-ms-db-migrate`: create new prisma migration based on changes made to `schema.prisma` file \
84+
`yarn dev-ms-db-deploy` : deploys the migrations to db \
85+
`yarn dev-ms-db-generate` : run this command to generate prisma client manually, if not generated automatically on `yarn install``
86+
7887
# Contributions
7988

8089
If you are interested in developing PROCEED further, we are very open for help and project contributions. Regularly there are on-boarding development workshops and, if you are interested, we have weekly video calls with all developers.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"dev-ms-db-migrate": "cd src/management-system-v2 && yarn prisma migrate dev",
4545
"dev-ms-db-use": "cd src/management-system-v2 && tsx scripts/db-helper.mts --use",
4646
"dev-ms-db-delete": "cd src/management-system-v2 && tsx scripts/db-helper.mts --delete",
47+
"dev-ms-db-generate": "cd src/management-system-v2 && yarn prisma generate",
4748
"dev-ms": "cd src/management-system-v2 && yarn dev",
4849
"dev-ms-old": "cd src/management-system && yarn web:dev",
4950
"dev-ms-old-iam": "cd src/management-system && yarn web:dev-iam",

src/management-system-v2/lib/data/file-manager-facade.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export async function updateArtifactProcessReference(
327327
processId: string,
328328
status: boolean,
329329
) {
330-
if (DEPLOYMENT_ENV !== 'cloud') return;
330+
//if (DEPLOYMENT_ENV !== 'cloud') return;
331331

332332
const artifact = await db.artifact.findUnique({
333333
where: { fileName },

src/management-system-v2/prisma/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ model Artifact {
9393
artifactType String // user-task, script, image, etc.
9494
processReferences ArtifactProcessReference[] // Relation to track references
9595
versionReferences ArtifactVersionReference[]
96-
refCounter Int @default(1)
96+
refCounter Int @default(0)
9797
9898
@@map("artifact")
9999
}

0 commit comments

Comments
 (0)