Initial commit: PodcastYes — AI podcast platform
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// Promote a user to admin by email. Run: npx tsx scripts/make-admin.ts you@email.com
|
||||
import "dotenv/config";
|
||||
import { prisma } from "@/lib/db";
|
||||
|
||||
async function main() {
|
||||
const email = process.argv[2];
|
||||
if (!email) {
|
||||
console.error("Usage: tsx scripts/make-admin.ts <email>");
|
||||
process.exit(1);
|
||||
}
|
||||
const user = await prisma.user.update({
|
||||
where: { email },
|
||||
data: { role: "admin" },
|
||||
});
|
||||
console.log(`✓ ${user.email} is now an admin.`);
|
||||
}
|
||||
|
||||
main()
|
||||
.catch((err) => {
|
||||
console.error("Failed:", err.message ?? err);
|
||||
process.exit(1);
|
||||
})
|
||||
.finally(() => prisma.$disconnect());
|
||||
Reference in New Issue
Block a user