x
This commit is contained in:
1 parent
5fac4524c8
commit
e1d793ce37
69 files changed
+1892
-610
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import prisma from './src/lib/prisma';
|
||||
async function main() {
|
||||
console.log('Starting deletion process...');
|
||||
try {
|
||||
// Delete all product variants first to avoid foreign key constraint errors
|
||||
const deletedVariants = await prisma.productVariant.deleteMany({});
|
||||
console.log(`Deleted ${deletedVariants.count} ProductVariants.`);
|
||||
// Delete all products
|
||||
const deletedProducts = await prisma.product.deleteMany({});
|
||||
console.log(`Deleted ${deletedProducts.count} Products.`);
|
||||
console.log('Deletion completed successfully.');
|
||||
}
|
||||
catch (error) {
|
||||
console.error('Error deleting products:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
main();
|
||||
//# sourceMappingURL=delete_products.js.map
|
||||
Reference in new issue
Block a user