chore(pnpm-lock.yaml): updated pnpm-lock

This commit is contained in:
dr-carrot
2024-11-04 18:04:40 -05:00
parent 46c3af115a
commit 96591a9ddd
3 changed files with 128 additions and 26 deletions

View File

@@ -1,21 +0,0 @@
import { isPgsql } from '@server/datasource';
import type { ColumnOptions, ColumnType } from 'typeorm';
import { Column } from 'typeorm';
// TODO cleanup this file
const pgTypeMapping: { [key: string]: ColumnType } = {
datetime: 'timestamp without time zone',
};
export function resolveDbType(pgType: ColumnType): ColumnType {
if (isPgsql && pgType.toString() in pgTypeMapping) {
return pgTypeMapping[pgType.toString()];
}
return pgType;
}
export function DbAwareColumn(columnOptions: ColumnOptions) {
if (columnOptions.type) {
columnOptions.type = resolveDbType(columnOptions.type);
}
return Column(columnOptions);
}