@wearesage/schema
Version:
A flexible schema definition and validation system for TypeScript with multi-database support
27 lines (21 loc) • 427 B
text/typescript
import "reflect-metadata";
import { Entity, Id, Property, ManyToMany } from "../..";
import { Post } from "./Post";
()
export class Tag {
()
id: string;
({ required: true, unique: true })
name: string;
// Timestamps
()
createdAt: Date;
()
updatedAt: Date;
({
target: () => Post,
inverse: "tags",
name: "HAS_TAG",
})
posts: Post[] = [];
}