Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions meridian-api/src/post/post.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ManyToMany,
JoinTable,
DeleteDateColumn,
Index,
} from 'typeorm';
import { postType } from './Enums/post-type.enum';
import { PostStatus } from './Enums/post-status.enum';
Expand All @@ -16,6 +17,7 @@ import { User } from 'src/users/user.entity';
import { Tag } from 'src/tag/tag.entity';

@Entity()
@Index(['authorId', 'postType', 'postStatus'])
export class Post {
@PrimaryGeneratedColumn()
id: number;
Expand Down
2 changes: 2 additions & 0 deletions meridian-api/src/tweets/entities/tweet.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import {
PrimaryColumn,
PrimaryGeneratedColumn,
UpdateDateColumn,
Index,
} from 'typeorm';

@Entity()
@Index(['userId'])
export class Tweet {
@PrimaryGeneratedColumn()
id: number;
Expand Down
2 changes: 2 additions & 0 deletions meridian-api/src/users/user.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
OneToOne,
JoinColumn,
DeleteDateColumn,
Index,
} from 'typeorm';

@Entity()
Expand All @@ -22,6 +23,7 @@ export class User {
@Column('varchar', { length: 100 })
lastName: string;

@Index()
@Column('varchar', { unique: true, nullable: false })
email: string;

Expand Down
Loading