* feat(user): Migrate user module to DML * Create rotten-tigers-worry.md * update indexes names following conventions * remove duplicate modifier
23 lines
517 B
TypeScript
23 lines
517 B
TypeScript
import { model } from "@medusajs/framework/utils"
|
|
|
|
export const Invite = model
|
|
.define("invite", {
|
|
id: model.id({ prefix: "invite" }).primaryKey(),
|
|
email: model.text().searchable(),
|
|
accepted: model.boolean().default(false),
|
|
token: model.text(),
|
|
expires_at: model.dateTime(),
|
|
metadata: model.json().nullable(),
|
|
})
|
|
.indexes([
|
|
{
|
|
on: ["email"],
|
|
unique: true,
|
|
where: "deleted_at IS NULL",
|
|
},
|
|
{
|
|
on: ["token"],
|
|
where: "deleted_at IS NULL",
|
|
},
|
|
])
|