Mark keys as primary with explicit method call (#7900)

This commit is contained in:
Harminder Virk
2024-07-02 13:27:21 +05:30
committed by GitHub
parent b25c6ab54f
commit 074e4a888e
13 changed files with 239 additions and 438 deletions

View File

@@ -2,7 +2,7 @@ import { model } from "@medusajs/utils"
import { Notification } from "./notification"
export const NotificationProvider = model.define("notificationProvider", {
id: model.id({ prefix: "notpro" }),
id: model.id({ prefix: "notpro" }).primaryKey(),
handle: model.text(),
name: model.text(),
is_enabled: model.boolean().default(true),

View File

@@ -3,7 +3,7 @@ import { NotificationProvider } from "./notification-provider"
// We probably want to have a TTL for each entry, so we don't bloat the DB (and also for GDPR reasons if TTL < 30 days).
export const Notification = model.define("notification", {
id: model.id({ prefix: "noti" }),
id: model.id({ prefix: "noti" }).primaryKey(),
// This can be an email, phone number, or username, depending on the channel.
to: model.text(),
channel: model.text(),