summary refs log tree commit diff
path: root/util/src/entities/Migration.ts
blob: 3f39ae7221fd6c4897ecab3a864aad65d0226417 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { Column, Entity, ObjectIdColumn, PrimaryGeneratedColumn } from "typeorm";
import { BaseClassWithoutId } from ".";

export const PrimaryIdAutoGenerated = process.env.DATABASE?.startsWith("mongodb")
	? ObjectIdColumn
	: PrimaryGeneratedColumn;

@Entity("migrations")
export class Migration extends BaseClassWithoutId {
	@PrimaryIdAutoGenerated()
	id: number;

	@Column({ type: "bigint" })
	timestamp: number;

	@Column()
	name: string;
}