UNPKG

json-api-nestjs

Version:
61 lines 1.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Notes = void 0; const tslib_1 = require("tslib"); const core_1 = require("@mikro-orm/core"); const index_1 = require("./index"); let Notes = class Notes { id; text; createdAt = new Date(); updatedAt = new Date(); createdBy; }; exports.Notes = Notes; tslib_1.__decorate([ (0, core_1.PrimaryKey)({ type: 'uuid', defaultRaw: 'gen_random_uuid()', }), tslib_1.__metadata("design:type", String) ], Notes.prototype, "id", void 0); tslib_1.__decorate([ (0, core_1.Property)({ type: 'text', nullable: false, }), tslib_1.__metadata("design:type", String) ], Notes.prototype, "text", void 0); tslib_1.__decorate([ (0, core_1.Property)({ length: 0, name: 'created_at', nullable: true, defaultRaw: 'CURRENT_TIMESTAMP(0)', columnType: 'timestamp(0) without time zone', }), tslib_1.__metadata("design:type", Date) ], Notes.prototype, "createdAt", void 0); tslib_1.__decorate([ (0, core_1.Property)({ length: 0, onUpdate: () => new Date(), name: 'updated_at', nullable: true, columnType: 'timestamp(0) without time zone', defaultRaw: 'CURRENT_TIMESTAMP(0)', }), tslib_1.__metadata("design:type", Date) ], Notes.prototype, "updatedAt", void 0); tslib_1.__decorate([ (0, core_1.ManyToOne)(() => index_1.Users, { fieldName: 'created_by', }), tslib_1.__metadata("design:type", Object) ], Notes.prototype, "createdBy", void 0); exports.Notes = Notes = tslib_1.__decorate([ (0, core_1.Entity)({ tableName: 'notes', }) ], Notes); //# sourceMappingURL=notes.js.map