From 330e38db75bdaa3c19e910bdcacdcf5062e136c0 Mon Sep 17 00:00:00 2001 From: CJ_Clippy Date: Tue, 17 Jun 2025 05:40:24 -0800 Subject: [PATCH] add uploader to vtuber creation --- services/our/README.md | 22 +++++++++++++++++++++- services/our/prisma/seed.ts | 7 ++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/services/our/README.md b/services/our/README.md index ac27ddc..7d06eda 100644 --- a/services/our/README.md +++ b/services/our/README.md @@ -77,4 +77,24 @@ If you have trouble installing sharp, try ignoring the system's installed libvip Actually, better advice is to probably **remove libvips from the system**. This way, a compatible libvips is always pulled during `npm install`. -Annoyingly, it might be necessary to re-install sharp after every new npm package, even if said package is unrelated to sharp. \ No newline at end of file +Annoyingly, it might be necessary to re-install sharp after every new npm package, even if said package is unrelated to sharp. + + +## Deployments + +### Apply migrations + + cd /opt/futureporn/services/our + npx @dotenvx/dotenvx run -f /usr/local/etc/futureporn/our/env -- npx prisma migrate deploy + +### pgweb + +https://github.com/sosedoff/pgweb/wiki/SSH-Gateway + + ssh -i ~/.ssh/futureporn2025 -Ng -L 5000:localhost:5432 root@45.63.66.171 + pgweb --url postgres://future_porn:REDACTED@localhost:5000/future_porn + + +### pgadmin + + dotenvx run -f ./.env.production -- docker run -p 5050:80 --rm --init -it -e PGADMIN_DEFAULT_EMAIL -e PGADMIN_DEFAULT_PASSWORD -e PGADMIN_DISABLE_POSTFIX=1 dpage/pgadmin4 \ No newline at end of file diff --git a/services/our/prisma/seed.ts b/services/our/prisma/seed.ts index 0bee9aa..481af41 100644 --- a/services/our/prisma/seed.ts +++ b/services/our/prisma/seed.ts @@ -42,11 +42,16 @@ async function main() { // Create Vtubers const vtubers = await Promise.all( - ['Alpha', 'Bravo', 'Charlie'].map((name) => + ['Alpha', 'Bravo', 'Charlie'].map((name, i) => prisma.vtuber.create({ data: { displayName: name, slug: name.toLowerCase(), + uploader: { + connect: { + id: users[i % users.length].id, // re-use existing seeded users + }, + }, }, }) )