mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
fix: switch timestamp to include timezone
This commit is contained in:
@@ -9,6 +9,7 @@ import type { DownloadingItem } from '@server/lib/downloadtracker';
|
||||
import downloadTracker from '@server/lib/downloadtracker';
|
||||
import { getSettings } from '@server/lib/settings';
|
||||
import logger from '@server/logger';
|
||||
import { DbAwareColumn } from '@server/utils/DbColumnHelper';
|
||||
import {
|
||||
AfterLoad,
|
||||
Column,
|
||||
@@ -121,10 +122,10 @@ class Media {
|
||||
@UpdateDateColumn()
|
||||
public updatedAt: Date;
|
||||
|
||||
@Column({ type: 'timestamp without time zone', default: () => 'now()' })
|
||||
@DbAwareColumn({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
||||
public lastSeasonChange: Date;
|
||||
|
||||
@Column({ type: 'timestamp without time zone', default: () => 'now()' })
|
||||
@DbAwareColumn({ type: 'datetime', nullable: true })
|
||||
public mediaAddedAt: Date;
|
||||
|
||||
@Column({ nullable: true, type: 'int' })
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
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',
|
||||
datetime: 'timestamp with time zone',
|
||||
};
|
||||
|
||||
export function resolveDbType(pgType: ColumnType): ColumnType {
|
||||
|
||||
Reference in New Issue
Block a user