✨ automatically run db migrations
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user