mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-15 00:51:53 +02:00
✨ Add scheduled events schema (#1679)
This commit is contained in:
parent
22f32f9314
commit
56bd684c55
35 changed files with 1412 additions and 659 deletions
43
packages/database/prisma/seed/users.ts
Normal file
43
packages/database/prisma/seed/users.ts
Normal file
|
@ -0,0 +1,43 @@
|
|||
import dayjs from "dayjs";
|
||||
import { prisma } from "@rallly/database";
|
||||
|
||||
export async function seedUsers() {
|
||||
console.info("Seeding users...");
|
||||
const freeUser = await prisma.user.upsert({
|
||||
where: { email: "dev@rallly.co" },
|
||||
update: {},
|
||||
create: {
|
||||
id: "free-user",
|
||||
name: "Dev User",
|
||||
email: "dev@rallly.co",
|
||||
timeZone: "America/New_York",
|
||||
},
|
||||
});
|
||||
|
||||
const proUser = await prisma.user.upsert({
|
||||
where: { email: "dev+pro@rallly.co" },
|
||||
update: {},
|
||||
create: {
|
||||
id: "pro-user",
|
||||
name: "Pro User",
|
||||
email: "dev+pro@rallly.co",
|
||||
subscription: {
|
||||
create: {
|
||||
id: "sub_123",
|
||||
currency: "usd",
|
||||
amount: 700,
|
||||
interval: "month",
|
||||
status: "active",
|
||||
active: true,
|
||||
priceId: "price_123",
|
||||
periodStart: new Date(),
|
||||
periodEnd: dayjs().add(1, "month").toDate(),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.info(`✓ Seeded user ${freeUser.email}`);
|
||||
console.info(`✓ Seeded user ${proUser.email}`);
|
||||
|
||||
return [freeUser, proUser];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue