2
0

🛂 Add setCustomPlan script

This commit is contained in:
Baptiste Arnaud
2022-11-16 09:04:37 +01:00
parent 4e6b8ed521
commit 6fdbf98eed
5 changed files with 100 additions and 10 deletions

View File

@@ -1,23 +1,22 @@
import { PrismaClient } from 'db'
import path from 'path'
import { setCustomPlan } from './setCustomPlan'
require('dotenv').config({
path: path.join(
__dirname,
process.env.NODE_ENV === 'staging' ? '.env.staging' : '.env.local'
process.env.NODE_ENV === 'production'
? '.env.production'
: process.env.NODE_ENV === 'staging'
? '.env.staging'
: '.env.local'
),
})
const prisma = new PrismaClient({ log: ['query', 'info', 'warn', 'error'] })
const main = async () => {
const workspaces = await prisma.workspace.findMany({
where: {
members: { some: { userId: 'coucou' } },
},
})
console.log(workspaces)
setCustomPlan()
}
main().then()