/
dimamir
/
medusa
Обзор
Документация
Войти
/
dimamir
/
medusa
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/modules/providers/locking-postgres/src/models/locking.ts
32 строки
625 B
Carlos R. L. Rodrigues
fea(providers): locking postgres (#9545)
17 окт 2024, 16:11
Не верифицирован
17 окт 2024, 16:11
e9a06f4
Код
Авторство
О чём код?
import { generateEntityId } from "@medusajs/framework/utils" import { BeforeCreate, Entity, OnInit, PrimaryKey, Property, } from "@mikro-orm/core" @Entity({ tableName: "locking" }) class Locking { @PrimaryKey({ columnType: "text" }) id!: string @Property({ columnType: "text", nullable: true }) owner_id: string | null = null @Property({ columnType: "timestamptz", nullable: true }) expiration: Date | null = null @BeforeCreate() onCreate() { this.id = generateEntityId(this.id, "lk") } @OnInit() onInit() { this.id = generateEntityId(this.id, "lk") } } export default Locking