fix: seed new preview secret types

This commit is contained in:
Andras Bacsai 2022-09-26 13:36:15 +02:00
parent 6501f71bd6
commit 360f4f8c27

View File

@ -94,6 +94,16 @@ async function main() {
}
});
}
// Set new preview secrets
const secrets = await prisma.secret.findMany({ where: { isPRMRSecret: false } })
if (secrets.length > 0) {
for (const secret of secrets) {
const previewSecrets = await prisma.secret.findMany({ where: { id: secret.id, isPRMRSecret: true } })
if (previewSecrets.length === 0) {
await prisma.secret.create({ data: { ...secret, id: undefined, isPRMRSecret: true } })
}
}
}
}
main()
.catch((e) => {