main
Some checks failed
Deploy Backend / deploy (push) Has been cancelled

This commit is contained in:
2026-02-05 01:29:22 +03:00
parent ae24c17f50
commit 80dcf4d04a
30 changed files with 14275 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function transfer() {
// Get target email from CLI args
const targetEmail = process.argv[2];
if (!targetEmail) {
console.error("❌ Usage: npx tsx scripts/transfer_projects.ts <target_email>");
process.exit(1);
}
console.log(`🚚 STARTING MIGRATION to: ${targetEmail}`);
// 1. Find Target User
const targetUser = await prisma.user.findUnique({ where: { email: targetEmail } });
if (!targetUser) {
console.error(`❌ User ${targetEmail} not found. Please register first!`);
process.exit(1);
}
// 2. Update ALL projects to point to this user
// (Except maybe "God Mode Test" projects? No, give them everything)
const result = await prisma.project.updateMany({
data: { userId: targetUser.id }
});
console.log(`✅ SUCCESS: Transferred ${result.count} projects to ${targetEmail}.`);
console.log(`🎉 They should now appear in the dashboard.`);
await prisma.$disconnect();
}
transfer();