Skip to content

Commit ca2df01

Browse files
committed
Update manual_migrations.ts
1 parent faea8d7 commit ca2df01

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

prisma/manual_migrations.ts

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PrismaClient } from '@prisma/client';
1+
import { PrismaClient, TestVariation } from '@prisma/client';
22

33
const prisma = new PrismaClient({
44
// log: ['query'],
@@ -32,24 +32,14 @@ async function setEmptyTestVariationTags_github_243() {
3232
return;
3333
}
3434
console.info(`Going to apply migration ${migrationKey}...`);
35-
const testVariations = await prisma.testVariation.findMany({
36-
where: {
37-
OR: [
38-
{
39-
os: undefined,
40-
},
41-
{
42-
device: undefined,
43-
},
44-
{
45-
browser: undefined,
46-
},
47-
{
48-
viewport: undefined,
49-
},
50-
],
51-
},
52-
});
35+
const testVariations = (await prisma.$queryRaw`
36+
SELECT * from "public"."TestVariation"
37+
WHERE
38+
"public"."TestVariation"."browser" IS NULL OR
39+
"public"."TestVariation"."os" IS NULL OR
40+
"public"."TestVariation"."device" IS NULL OR
41+
"public"."TestVariation"."viewport" IS NULL
42+
`) as Array<TestVariation>;
5343

5444
return Promise.all(
5545
testVariations.map((testVariation) =>

0 commit comments

Comments
 (0)