adde images to plugins

This commit is contained in:
2026-11-05 18:01:08 +03:30
parent 97815aba76
commit a1d2c222bd
2 changed files with 119 additions and 66 deletions
@@ -0,0 +1,36 @@
import { PrismaClient } from '@prisma/client';
import { PLUGIN_CATALOG_SEED } from '../src/plugins/plugin-catalog.seed';
const prisma = new PrismaClient();
async function main() {
console.log('Updating plugin store catalog descriptions in database...');
let updatedCount = 0;
for (const seed of PLUGIN_CATALOG_SEED) {
const res = await prisma.pluginCatalogItem.updateMany({
where: { settingKey: seed.settingKey },
data: {
description: seed.description,
titleFa: seed.titleFa,
},
});
if (res.count > 0) {
console.log(`✓ Updated [${seed.settingKey}] - ${seed.titleFa}`);
updatedCount += res.count;
} else {
console.log(`- Item [${seed.settingKey}] not yet in DB (will be seeded on next bootstrap)`);
}
}
console.log(`\nSuccessfully updated ${updatedCount} plugin store items!`);
}
main()
.catch((e) => {
console.error('Error updating descriptions:', e);
process.exit(1);
})
.finally(async () => {
await prisma.$disconnect();
});