On db sync/first run, add all the current migrations to migrations table to prevent running them on restarts
This commit is contained in:
@@ -21,8 +21,8 @@ import {
|
||||
Entity,
|
||||
ObjectIdColumn,
|
||||
PrimaryGeneratedColumn,
|
||||
BaseEntity,
|
||||
} from "typeorm";
|
||||
import { BaseClassWithoutId } from "./BaseClass";
|
||||
|
||||
export const PrimaryIdAutoGenerated = process.env.DATABASE?.startsWith(
|
||||
"mongodb",
|
||||
@@ -31,7 +31,7 @@ export const PrimaryIdAutoGenerated = process.env.DATABASE?.startsWith(
|
||||
: PrimaryGeneratedColumn;
|
||||
|
||||
@Entity("migrations")
|
||||
export class Migration extends BaseClassWithoutId {
|
||||
export class Migration extends BaseEntity {
|
||||
@PrimaryIdAutoGenerated()
|
||||
id: number;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user