mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat: rename schema (#19891)
This commit is contained in:
parent
33c29e4305
commit
c699df002a
103 changed files with 4378 additions and 3224 deletions
|
|
@ -13,7 +13,7 @@ import {
|
|||
UserStatus,
|
||||
} from 'src/enum';
|
||||
import { AlbumTable } from 'src/schema/tables/album.table';
|
||||
import { ExifTable } from 'src/schema/tables/exif.table';
|
||||
import { AssetExifTable } from 'src/schema/tables/asset-exif.table';
|
||||
import { UserMetadataItem } from 'src/types';
|
||||
|
||||
export type AuthUser = {
|
||||
|
|
@ -242,7 +242,7 @@ export type Session = {
|
|||
isPendingSyncReset: boolean;
|
||||
};
|
||||
|
||||
export type Exif = Omit<Selectable<ExifTable>, 'updatedAt' | 'updateId'>;
|
||||
export type Exif = Omit<Selectable<AssetExifTable>, 'updatedAt' | 'updateId'>;
|
||||
|
||||
export type Person = {
|
||||
createdAt: Date;
|
||||
|
|
@ -276,52 +276,45 @@ export type AssetFace = {
|
|||
|
||||
const userColumns = ['id', 'name', 'email', 'avatarColor', 'profileImagePath', 'profileChangedAt'] as const;
|
||||
const userWithPrefixColumns = [
|
||||
'users.id',
|
||||
'users.name',
|
||||
'users.email',
|
||||
'users.avatarColor',
|
||||
'users.profileImagePath',
|
||||
'users.profileChangedAt',
|
||||
'user2.id',
|
||||
'user2.name',
|
||||
'user2.email',
|
||||
'user2.avatarColor',
|
||||
'user2.profileImagePath',
|
||||
'user2.profileChangedAt',
|
||||
] as const;
|
||||
|
||||
export const columns = {
|
||||
asset: [
|
||||
'assets.id',
|
||||
'assets.checksum',
|
||||
'assets.deviceAssetId',
|
||||
'assets.deviceId',
|
||||
'assets.fileCreatedAt',
|
||||
'assets.fileModifiedAt',
|
||||
'assets.isExternal',
|
||||
'assets.visibility',
|
||||
'assets.libraryId',
|
||||
'assets.livePhotoVideoId',
|
||||
'assets.localDateTime',
|
||||
'assets.originalFileName',
|
||||
'assets.originalPath',
|
||||
'assets.ownerId',
|
||||
'assets.sidecarPath',
|
||||
'assets.type',
|
||||
'asset.id',
|
||||
'asset.checksum',
|
||||
'asset.deviceAssetId',
|
||||
'asset.deviceId',
|
||||
'asset.fileCreatedAt',
|
||||
'asset.fileModifiedAt',
|
||||
'asset.isExternal',
|
||||
'asset.visibility',
|
||||
'asset.libraryId',
|
||||
'asset.livePhotoVideoId',
|
||||
'asset.localDateTime',
|
||||
'asset.originalFileName',
|
||||
'asset.originalPath',
|
||||
'asset.ownerId',
|
||||
'asset.sidecarPath',
|
||||
'asset.type',
|
||||
],
|
||||
assetFiles: ['asset_files.id', 'asset_files.path', 'asset_files.type'],
|
||||
authUser: [
|
||||
'users.id',
|
||||
'users.name',
|
||||
'users.email',
|
||||
'users.isAdmin',
|
||||
'users.quotaUsageInBytes',
|
||||
'users.quotaSizeInBytes',
|
||||
],
|
||||
authApiKey: ['api_keys.id', 'api_keys.permissions'],
|
||||
authSession: ['sessions.id', 'sessions.isPendingSyncReset', 'sessions.updatedAt', 'sessions.pinExpiresAt'],
|
||||
assetFiles: ['asset_file.id', 'asset_file.path', 'asset_file.type'],
|
||||
authUser: ['user.id', 'user.name', 'user.email', 'user.isAdmin', 'user.quotaUsageInBytes', 'user.quotaSizeInBytes'],
|
||||
authApiKey: ['api_key.id', 'api_key.permissions'],
|
||||
authSession: ['session.id', 'session.isPendingSyncReset', 'session.updatedAt', 'session.pinExpiresAt'],
|
||||
authSharedLink: [
|
||||
'shared_links.id',
|
||||
'shared_links.userId',
|
||||
'shared_links.expiresAt',
|
||||
'shared_links.showExif',
|
||||
'shared_links.allowUpload',
|
||||
'shared_links.allowDownload',
|
||||
'shared_links.password',
|
||||
'shared_link.id',
|
||||
'shared_link.userId',
|
||||
'shared_link.expiresAt',
|
||||
'shared_link.showExif',
|
||||
'shared_link.allowUpload',
|
||||
'shared_link.allowDownload',
|
||||
'shared_link.password',
|
||||
],
|
||||
user: userColumns,
|
||||
userWithPrefix: userWithPrefixColumns,
|
||||
|
|
@ -339,89 +332,83 @@ export const columns = {
|
|||
'quotaSizeInBytes',
|
||||
'quotaUsageInBytes',
|
||||
],
|
||||
tag: ['tags.id', 'tags.value', 'tags.createdAt', 'tags.updatedAt', 'tags.color', 'tags.parentId'],
|
||||
tag: ['tag.id', 'tag.value', 'tag.createdAt', 'tag.updatedAt', 'tag.color', 'tag.parentId'],
|
||||
apiKey: ['id', 'name', 'userId', 'createdAt', 'updatedAt', 'permissions'],
|
||||
notification: ['id', 'createdAt', 'level', 'type', 'title', 'description', 'data', 'readAt'],
|
||||
syncAsset: [
|
||||
'assets.id',
|
||||
'assets.ownerId',
|
||||
'assets.originalFileName',
|
||||
'assets.thumbhash',
|
||||
'assets.checksum',
|
||||
'assets.fileCreatedAt',
|
||||
'assets.fileModifiedAt',
|
||||
'assets.localDateTime',
|
||||
'assets.type',
|
||||
'assets.deletedAt',
|
||||
'assets.isFavorite',
|
||||
'assets.visibility',
|
||||
'assets.duration',
|
||||
],
|
||||
syncAlbumUser: ['album_users.albumsId as albumId', 'album_users.usersId as userId', 'album_users.role'],
|
||||
syncStack: [
|
||||
'asset_stack.id',
|
||||
'asset_stack.createdAt',
|
||||
'asset_stack.updatedAt',
|
||||
'asset_stack.primaryAssetId',
|
||||
'asset_stack.ownerId',
|
||||
'asset.id',
|
||||
'asset.ownerId',
|
||||
'asset.originalFileName',
|
||||
'asset.thumbhash',
|
||||
'asset.checksum',
|
||||
'asset.fileCreatedAt',
|
||||
'asset.fileModifiedAt',
|
||||
'asset.localDateTime',
|
||||
'asset.type',
|
||||
'asset.deletedAt',
|
||||
'asset.isFavorite',
|
||||
'asset.visibility',
|
||||
'asset.duration',
|
||||
],
|
||||
syncAlbumUser: ['album_user.albumsId as albumId', 'album_user.usersId as userId', 'album_user.role'],
|
||||
syncStack: ['stack.id', 'stack.createdAt', 'stack.updatedAt', 'stack.primaryAssetId', 'stack.ownerId'],
|
||||
stack: ['stack.id', 'stack.primaryAssetId', 'ownerId'],
|
||||
syncAssetExif: [
|
||||
'exif.assetId',
|
||||
'exif.description',
|
||||
'exif.exifImageWidth',
|
||||
'exif.exifImageHeight',
|
||||
'exif.fileSizeInByte',
|
||||
'exif.orientation',
|
||||
'exif.dateTimeOriginal',
|
||||
'exif.modifyDate',
|
||||
'exif.timeZone',
|
||||
'exif.latitude',
|
||||
'exif.longitude',
|
||||
'exif.projectionType',
|
||||
'exif.city',
|
||||
'exif.state',
|
||||
'exif.country',
|
||||
'exif.make',
|
||||
'exif.model',
|
||||
'exif.lensModel',
|
||||
'exif.fNumber',
|
||||
'exif.focalLength',
|
||||
'exif.iso',
|
||||
'exif.exposureTime',
|
||||
'exif.profileDescription',
|
||||
'exif.rating',
|
||||
'exif.fps',
|
||||
'asset_exif.assetId',
|
||||
'asset_exif.description',
|
||||
'asset_exif.exifImageWidth',
|
||||
'asset_exif.exifImageHeight',
|
||||
'asset_exif.fileSizeInByte',
|
||||
'asset_exif.orientation',
|
||||
'asset_exif.dateTimeOriginal',
|
||||
'asset_exif.modifyDate',
|
||||
'asset_exif.timeZone',
|
||||
'asset_exif.latitude',
|
||||
'asset_exif.longitude',
|
||||
'asset_exif.projectionType',
|
||||
'asset_exif.city',
|
||||
'asset_exif.state',
|
||||
'asset_exif.country',
|
||||
'asset_exif.make',
|
||||
'asset_exif.model',
|
||||
'asset_exif.lensModel',
|
||||
'asset_exif.fNumber',
|
||||
'asset_exif.focalLength',
|
||||
'asset_exif.iso',
|
||||
'asset_exif.exposureTime',
|
||||
'asset_exif.profileDescription',
|
||||
'asset_exif.rating',
|
||||
'asset_exif.fps',
|
||||
],
|
||||
exif: [
|
||||
'exif.assetId',
|
||||
'exif.autoStackId',
|
||||
'exif.bitsPerSample',
|
||||
'exif.city',
|
||||
'exif.colorspace',
|
||||
'exif.country',
|
||||
'exif.dateTimeOriginal',
|
||||
'exif.description',
|
||||
'exif.exifImageHeight',
|
||||
'exif.exifImageWidth',
|
||||
'exif.exposureTime',
|
||||
'exif.fileSizeInByte',
|
||||
'exif.fNumber',
|
||||
'exif.focalLength',
|
||||
'exif.fps',
|
||||
'exif.iso',
|
||||
'exif.latitude',
|
||||
'exif.lensModel',
|
||||
'exif.livePhotoCID',
|
||||
'exif.longitude',
|
||||
'exif.make',
|
||||
'exif.model',
|
||||
'exif.modifyDate',
|
||||
'exif.orientation',
|
||||
'exif.profileDescription',
|
||||
'exif.projectionType',
|
||||
'exif.rating',
|
||||
'exif.state',
|
||||
'exif.timeZone',
|
||||
'asset_exif.assetId',
|
||||
'asset_exif.autoStackId',
|
||||
'asset_exif.bitsPerSample',
|
||||
'asset_exif.city',
|
||||
'asset_exif.colorspace',
|
||||
'asset_exif.country',
|
||||
'asset_exif.dateTimeOriginal',
|
||||
'asset_exif.description',
|
||||
'asset_exif.exifImageHeight',
|
||||
'asset_exif.exifImageWidth',
|
||||
'asset_exif.exposureTime',
|
||||
'asset_exif.fileSizeInByte',
|
||||
'asset_exif.fNumber',
|
||||
'asset_exif.focalLength',
|
||||
'asset_exif.fps',
|
||||
'asset_exif.iso',
|
||||
'asset_exif.latitude',
|
||||
'asset_exif.lensModel',
|
||||
'asset_exif.livePhotoCID',
|
||||
'asset_exif.longitude',
|
||||
'asset_exif.make',
|
||||
'asset_exif.model',
|
||||
'asset_exif.modifyDate',
|
||||
'asset_exif.orientation',
|
||||
'asset_exif.profileDescription',
|
||||
'asset_exif.projectionType',
|
||||
'asset_exif.rating',
|
||||
'asset_exif.state',
|
||||
'asset_exif.timeZone',
|
||||
],
|
||||
} as const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue