Skip to content

Commit

Permalink
Merge pull request #533 from Zen-cronic/fix/postgres-compatibility
Browse files Browse the repository at this point in the history
Fix(postgres): Fix postgres server start and type cast `created_at` field
  • Loading branch information
evert authored Oct 4, 2024
2 parents e855ee6 + d8fe0a5 commit 7fb70bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export function getSettings(): Knex.Config {
searchPath = [
connection.user as string,
connection.database as string,
'public',
];
break;
case 'mysql' :
Expand Down
6 changes: 3 additions & 3 deletions src/principal-identity/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ function recordToModel(principal: Principal, record: PrincipalIdentitiesRecord):
externalId: record.external_id,
label: record.label,
isPrimary: !!record.is_primary,
verifiedAt: record.verified_at ? new Date(record.verified_at) : null,
createdAt: new Date(record.created_at),
modifiedAt: new Date(record.modified_at),
verifiedAt: record.verified_at ? new Date(+record.verified_at) : null,
createdAt: new Date(+record.created_at),
modifiedAt: new Date(+record.modified_at),
};

}
4 changes: 2 additions & 2 deletions src/principal/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ function recordToModel(user: PrincipalsRecord): Principal {
href: `/${userTypeIntToUserType(user.type)}/${user.external_id}`,
externalId: user.external_id,
nickname: user.nickname!,
createdAt: new Date(user.created_at),
modifiedAt: new Date(user.modified_at),
createdAt: new Date(+user.created_at),
modifiedAt: new Date(+user.modified_at),
type: userTypeIntToUserType(user.type),
active: !!user.active,
system: !!user.system,
Expand Down

0 comments on commit 7fb70bd

Please sign in to comment.