anatid-blog/backend/src/post/post.entity.ts
Phill Pover 6b414d9b71
All checks were successful
Anatid Blog CI Workflow / test (./backend) (push) Successful in 28s
Anatid Blog CI Workflow / test (./frontend) (push) Successful in 29s
Anatid Blog CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/anatid-blog-backend, ./backend) (push) Successful in 51s
Anatid Blog CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/anatid-blog-frontend, ./frontend) (push) Successful in 43s
Anatid Blog CI Workflow / deploy (push) Successful in 23s
Fixing tests
2025-03-29 09:48:39 +00:00

20 lines
348 B
TypeScript

import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
import { Comment } from '../comment/comment.entity';
@Entity()
export class Post {
@PrimaryGeneratedColumn()
id: number;
@Column()
title: string;
@Column()
content: string;
@OneToMany(() => Comment, (comment) => comment.post)
comments: Comment[];
}