mirror of
https://github.com/documenso/documenso.git
synced 2025-11-24 13:41:30 +10:00
fix: remove invalid seed
This commit is contained in:
@ -13,7 +13,13 @@ const seedDatabase = async () => {
|
|||||||
|
|
||||||
if ('seedDatabase' in mod && typeof mod.seedDatabase === 'function') {
|
if ('seedDatabase' in mod && typeof mod.seedDatabase === 'function') {
|
||||||
console.log(`[SEEDING]: ${file}`);
|
console.log(`[SEEDING]: ${file}`);
|
||||||
await mod.seedDatabase();
|
|
||||||
|
try {
|
||||||
|
await mod.seedDatabase();
|
||||||
|
} catch (e) {
|
||||||
|
console.log(`[SEEDING]: Seed failed for ${file}`);
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,24 +39,12 @@ export const seedDatabase = async () => {
|
|||||||
update: {},
|
update: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
const documentIdToSeed = 'clmn0kv5k0000pe04vcqg5zla';
|
|
||||||
|
|
||||||
const oldSeededDocument = await prisma.documentData.findFirst({
|
|
||||||
where: {
|
|
||||||
id: documentIdToSeed,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (oldSeededDocument) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const examplePdfData = await prisma.documentData.upsert({
|
const examplePdfData = await prisma.documentData.upsert({
|
||||||
where: {
|
where: {
|
||||||
id: documentIdToSeed,
|
id: 'clmn0kv5k0000pe04vcqg5zla',
|
||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
id: documentIdToSeed,
|
id: 'clmn0kv5k0000pe04vcqg5zla',
|
||||||
type: DocumentDataType.BYTES_64,
|
type: DocumentDataType.BYTES_64,
|
||||||
data: examplePdf,
|
data: examplePdf,
|
||||||
initialData: examplePdf,
|
initialData: examplePdf,
|
||||||
|
|||||||
Reference in New Issue
Block a user