mirror of
https://github.com/immich-app/immich.git
synced 2026-03-01 18:19:10 +03:00
feat: schema diff sql tools (#17116)
This commit is contained in:
@@ -316,9 +316,9 @@ const getEnv = (): EnvData => {
|
||||
config: {
|
||||
typeorm: {
|
||||
type: 'postgres',
|
||||
entities: [`${folders.dist}/entities` + '/*.entity.{js,ts}'],
|
||||
entities: [],
|
||||
migrations: [`${folders.dist}/migrations` + '/*.{js,ts}'],
|
||||
subscribers: [`${folders.dist}/subscribers` + '/*.{js,ts}'],
|
||||
subscribers: [],
|
||||
migrationsRun: false,
|
||||
synchronize: false,
|
||||
connectTimeoutMS: 10_000, // 10 seconds
|
||||
|
||||
@@ -9,7 +9,6 @@ import { PersonEntity } from 'src/entities/person.entity';
|
||||
import { SourceType } from 'src/enum';
|
||||
import { removeUndefinedKeys } from 'src/utils/database';
|
||||
import { Paginated, PaginationOptions } from 'src/utils/pagination';
|
||||
import { FindOptionsRelations } from 'typeorm';
|
||||
|
||||
export interface PersonSearchOptions {
|
||||
minimumFaceCount: number;
|
||||
@@ -247,7 +246,7 @@ export class PersonRepository {
|
||||
@GenerateSql({ params: [DummyValue.UUID] })
|
||||
getFaceByIdWithAssets(
|
||||
id: string,
|
||||
relations?: FindOptionsRelations<AssetFaceEntity>,
|
||||
relations?: { faceSearch?: boolean },
|
||||
select?: SelectFaceOptions,
|
||||
): Promise<AssetFaceEntity | undefined> {
|
||||
return this.db
|
||||
|
||||
@@ -4,7 +4,7 @@ import { InjectKysely } from 'nestjs-kysely';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { DB, SystemMetadata as DbSystemMetadata } from 'src/db';
|
||||
import { GenerateSql } from 'src/decorators';
|
||||
import { SystemMetadata } from 'src/entities/system-metadata.entity';
|
||||
import { SystemMetadata } from 'src/types';
|
||||
|
||||
type Upsert = Insertable<DbSystemMetadata>;
|
||||
|
||||
|
||||
@@ -3,11 +3,12 @@ import { Insertable, Kysely, sql, Updateable } from 'kysely';
|
||||
import { DateTime } from 'luxon';
|
||||
import { InjectKysely } from 'nestjs-kysely';
|
||||
import { columns, UserAdmin } from 'src/database';
|
||||
import { DB, UserMetadata as DbUserMetadata, Users } from 'src/db';
|
||||
import { DB, UserMetadata as DbUserMetadata } from 'src/db';
|
||||
import { DummyValue, GenerateSql } from 'src/decorators';
|
||||
import { UserMetadata, UserMetadataItem } from 'src/entities/user-metadata.entity';
|
||||
import { UserEntity, withMetadata } from 'src/entities/user.entity';
|
||||
import { AssetType, UserStatus } from 'src/enum';
|
||||
import { UserTable } from 'src/tables/user.table';
|
||||
import { asUuid } from 'src/utils/database';
|
||||
|
||||
type Upsert = Insertable<DbUserMetadata>;
|
||||
@@ -128,7 +129,7 @@ export class UserRepository {
|
||||
.execute() as Promise<UserAdmin[]>;
|
||||
}
|
||||
|
||||
async create(dto: Insertable<Users>): Promise<UserEntity> {
|
||||
async create(dto: Insertable<UserTable>): Promise<UserEntity> {
|
||||
return this.db
|
||||
.insertInto('users')
|
||||
.values(dto)
|
||||
@@ -136,7 +137,7 @@ export class UserRepository {
|
||||
.executeTakeFirst() as unknown as Promise<UserEntity>;
|
||||
}
|
||||
|
||||
update(id: string, dto: Updateable<Users>): Promise<UserEntity> {
|
||||
update(id: string, dto: Updateable<UserTable>): Promise<UserEntity> {
|
||||
return this.db
|
||||
.updateTable('users')
|
||||
.set(dto)
|
||||
|
||||
Reference in New Issue
Block a user