feat(db): Drizzle ORM schema and migrations
Schema domains: users/auth, recipes, social, meal-planning, tiers/usage, webhooks. Includes Better Auth tables, audit_logs, site_settings, push_subscriptions, user_model_prefs, user_nutrition_goals. Migrations 0000–0008 applied.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { db } from "./client";
|
||||
import { tierDefinitions } from "./schema";
|
||||
|
||||
async function seed() {
|
||||
console.log("Seeding tier definitions...");
|
||||
await db
|
||||
.insert(tierDefinitions)
|
||||
.values([
|
||||
{
|
||||
tier: "free",
|
||||
maxRecipes: 50,
|
||||
aiCallsPerMonth: 10,
|
||||
storageMb: 500,
|
||||
maxPublicRecipes: 5,
|
||||
},
|
||||
{
|
||||
tier: "pro",
|
||||
maxRecipes: 99999,
|
||||
aiCallsPerMonth: 500,
|
||||
storageMb: 10000,
|
||||
maxPublicRecipes: 99999,
|
||||
},
|
||||
])
|
||||
.onConflictDoNothing();
|
||||
|
||||
console.log("Seed complete.");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
seed().catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user