first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:09:32 +03:00
commit 71eff2d979
78 changed files with 10173 additions and 0 deletions

35
make-admin.ts Normal file
View File

@@ -0,0 +1,35 @@
// Admin kullanıcı oluşturma scripti
import { db } from "./db";
import { user } from "./db/schema";
import { eq } from "drizzle-orm";
async function makeAdmin() {
const email = process.argv[2];
if (!email) {
console.error("Kullanım: tsx make-admin.mjs email@example.com");
process.exit(1);
}
try {
const result = await db
.update(user)
.set({ role: "admin" })
.where(eq(user.email, email))
.returning();
if (result.length === 0) {
console.error(`${email} bulunamadı`);
process.exit(1);
}
console.log(`${email} artık admin!`);
console.log(result[0]);
process.exit(0);
} catch (error: any) {
console.error("Hata:", error.message);
process.exit(1);
}
}
makeAdmin();