Files
medusa-store/packages/modules/user/src/models/invite.ts
Adrien de Peretti ac79585232 feat(user): Migrate user module to DML (#10389)
* feat(user): Migrate user module to DML

* Create rotten-tigers-worry.md

* update indexes names following conventions

* remove duplicate modifier
2024-12-02 12:36:40 +01:00

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",
},
])