Skip to content

Commit

Permalink
Ms2/read me db commands update (#443)
Browse files Browse the repository at this point in the history
* updated readme.md

* minor refCounter bug fix

* fix: readme

---------

Co-authored-by: Kai Rohwer <rohwer.kai@icloud.com>
  • Loading branch information
anishsapkota and OhKai authored Jan 20, 2025
1 parent 878af1f commit 907345b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ When you have started the development code of the Management System, the first i

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_.

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

# Contributions

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.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"dev-ms-db-migrate": "cd src/management-system-v2 && yarn prisma migrate dev",
"dev-ms-db-use": "cd src/management-system-v2 && tsx scripts/db-helper.mts --use",
"dev-ms-db-delete": "cd src/management-system-v2 && tsx scripts/db-helper.mts --delete",
"dev-ms-db-generate": "cd src/management-system-v2 && yarn prisma generate",
"dev-ms": "cd src/management-system-v2 && yarn dev",
"dev-ms-old": "cd src/management-system && yarn web:dev",
"dev-ms-old-iam": "cd src/management-system && yarn web:dev-iam",
Expand Down
2 changes: 1 addition & 1 deletion src/management-system-v2/lib/data/file-manager-facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export async function updateArtifactProcessReference(
processId: string,
status: boolean,
) {
if (DEPLOYMENT_ENV !== 'cloud') return;
//if (DEPLOYMENT_ENV !== 'cloud') return;

const artifact = await db.artifact.findUnique({
where: { fileName },
Expand Down
2 changes: 1 addition & 1 deletion src/management-system-v2/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ model Artifact {
artifactType String // user-task, script, image, etc.
processReferences ArtifactProcessReference[] // Relation to track references
versionReferences ArtifactVersionReference[]
refCounter Int @default(1)
refCounter Int @default(0)
@@map("artifact")
}
Expand Down

0 comments on commit 907345b

Please sign in to comment.