From 7903dbdaf3098022560d0592e5d9a70378ae9630 Mon Sep 17 00:00:00 2001 From: keyan Date: Fri, 14 Jan 2022 11:28:05 -0600 Subject: [PATCH] WIP trust --- prisma/migrations/20220114153522_add_trust/migration.sql | 2 ++ prisma/schema.prisma | 1 + worker/index.js | 5 +++++ 3 files changed, 8 insertions(+) create mode 100644 prisma/migrations/20220114153522_add_trust/migration.sql diff --git a/prisma/migrations/20220114153522_add_trust/migration.sql b/prisma/migrations/20220114153522_add_trust/migration.sql new file mode 100644 index 00000000..7cf83310 --- /dev/null +++ b/prisma/migrations/20220114153522_add_trust/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "users" ADD COLUMN "trust" DOUBLE PRECISION NOT NULL DEFAULT 0; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 06d423ef..8539b64e 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -35,6 +35,7 @@ model User { checkedNotesAt DateTime? tipDefault Int @default(1) pubkey String? @unique + trust Float @default(0) upvotePopover Boolean @default(false) tipPopover Boolean @default(false) diff --git a/worker/index.js b/worker/index.js index 924ad970..3b4ac013 100644 --- a/worker/index.js +++ b/worker/index.js @@ -22,9 +22,14 @@ async function work () { await boss.work('checkInvoice', checkInvoice) await boss.work('checkWithdrawal', checkWithdrawal) await boss.work('repin-*', repin) + await boss.work('trust', trust) console.log('working jobs') } +async function trust () { + return null +} + async function repin ({ name }) { console.log(name) // get the id