2
0

fix(results): 🐛 Make sure delete all works

This commit is contained in:
Baptiste Arnaud
2022-06-19 11:10:11 +02:00
parent d991dd5467
commit 18c5ea5207
5 changed files with 58 additions and 32 deletions

View File

@ -1,5 +1,25 @@
import { CollaborationType, PrismaClient } from 'db'
import path from 'path'
import { migrateWorkspace } from './workspaceMigration'
const prisma = new PrismaClient({
log: [
{
emit: 'event',
level: 'query',
},
{
emit: 'stdout',
level: 'error',
},
{
emit: 'stdout',
level: 'info',
},
{
emit: 'stdout',
level: 'warn',
},
],
})
require('dotenv').config({
path: path.join(
@ -9,7 +29,14 @@ require('dotenv').config({
})
const main = async () => {
await migrateWorkspace()
prisma.$on('query', (e) => {
console.log('Query: ' + e.query)
console.log('Params: ' + e.params)
console.log('Duration: ' + e.duration + 'ms')
})
const results =
await prisma.$queryRaw`DELETE FROM "public"."Result" WHERE "public"."Result"."typebotId"='ckzqqer3j002509l3np5x3v2y'`
console.log(results)
}
main().then()