Creating a primary column
Each entity must have at least one primary key column.This is a requirement and you can’t avoid it.To make a column a primary key, you need to use @PrimaryColumn
decorator.
import {Entity, Column, PrimaryColumn} from "typeorm";
@Entity()
export class Photo {
@PrimaryColumn()
id: number;
@Column()
name: string;
@Column()
description: string;
@Column()
filename: string;
@Column()
views: number;
@Column()
isPublished: boolean;
}