Files
diabetix/reset-db.mjs
jeremy bayse e7f151d14e feat: Initial Diabetix application commit
- Add authentication with NextAuth v5 (credentials + email verification)
- Implement dashboard with glycemia tracking and AI analysis
- Add PDF report generation for Premium users
- Implement Stripe integration for Premium subscriptions
- Add responsive UI with Tailwind CSS and shadcn components
- Database schema with Prisma ORM and PostgreSQL support
- Real-time glycemia visualization with Recharts
- Mobile-optimized entry form
- User profile management with medical information
- Subscription lifecycle management (create, cancel, webhook)
- Email notifications with Resend
- Feature gates for Free vs Premium plans

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 23:06:29 +02:00

29 lines
736 B
JavaScript

import { PrismaClient } from "@prisma/client";
import fs from "fs";
import path from "path";
const dbPath = "./prisma/dev.db";
if (fs.existsSync(dbPath)) {
fs.unlinkSync(dbPath);
console.log("Database deleted");
}
const prisma = new PrismaClient();
await prisma.$executeRawUnsafe(`
CREATE TABLE "_prisma_migrations" (
"id" TEXT NOT NULL PRIMARY KEY,
"checksum" TEXT NOT NULL,
"finished_at" DATETIME,
"execution_time" INTEGER NOT NULL,
"migration_name" TEXT NOT NULL,
"logs" TEXT,
"rolled_back_at" DATETIME,
"started_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"applied_steps_count" INTEGER NOT NULL DEFAULT 0
)
`);
await prisma.$disconnect();
console.log("Database reset complete");