✨ automatically run db migrations

This commit is contained in:
Flam3rboy
2021-10-15 18:39:19 +02:00
parent e1b991dfd1
commit 4be8d3414e
6 changed files with 106 additions and 1 deletions
+18
View File
@@ -0,0 +1,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()
timestamp: number;
@Column()
name: string;
}
+1
View File
@@ -11,6 +11,7 @@ export * from "./Guild";
export * from "./Invite";
export * from "./Member";
export * from "./Message";
export * from "./Migration";
export * from "./RateLimit";
export * from "./ReadState";
export * from "./Recipient";