Raw
1 import { model } from "@medusajs/framework/utils"
2
3 export const Invite = model
4 .define("invite", {
5 id: model.id({ prefix: "invite" }).primaryKey(),
6 email: model.text().searchable(),
7 accepted: model.boolean().default(false),
8 token: model.text(),
9 expires_at: model.dateTime(),
10 metadata: model.json().nullable(),
11 })
12 .indexes([
13 {
14 on: ["email"],
15 unique: true,
16 where: "deleted_at IS NULL",
17 },
18 {
19 on: ["token"],
20 where: "deleted_at IS NULL",
21 },
22 ])