fix(results): 🐛 Make sure delete all works
This commit is contained in:
@@ -5,13 +5,12 @@
|
||||
"main": "./index.ts",
|
||||
"types": "./index.ts",
|
||||
"devDependencies": {
|
||||
"prisma": "^3.14.0",
|
||||
"ts-node": "^10.7.0",
|
||||
"prisma": "^3.15.2",
|
||||
"typescript": "^4.6.4",
|
||||
"dotenv-cli": "5.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "^3.14.0"
|
||||
"@prisma/client": "^3.15.2"
|
||||
},
|
||||
"scripts": {
|
||||
"dx": "dotenv -e ../../apps/builder/.env.local prisma db push && yarn generate:schema && yarn start:sutdio ",
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user