diff options
Diffstat (limited to 'src/util/entities/Migration.ts')
-rw-r--r-- | src/util/entities/Migration.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/util/entities/Migration.ts b/src/util/entities/Migration.ts index 3f39ae72..f4e54eae 100644 --- a/src/util/entities/Migration.ts +++ b/src/util/entities/Migration.ts @@ -1,7 +1,14 @@ -import { Column, Entity, ObjectIdColumn, PrimaryGeneratedColumn } from "typeorm"; +import { + Column, + Entity, + ObjectIdColumn, + PrimaryGeneratedColumn, +} from "typeorm"; import { BaseClassWithoutId } from "."; -export const PrimaryIdAutoGenerated = process.env.DATABASE?.startsWith("mongodb") +export const PrimaryIdAutoGenerated = process.env.DATABASE?.startsWith( + "mongodb", +) ? ObjectIdColumn : PrimaryGeneratedColumn; |