mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor: database types (#19624)
This commit is contained in:
parent
09cbc5d3f4
commit
e60bc3c304
99 changed files with 518 additions and 889 deletions
|
|
@ -5,8 +5,10 @@ import {
|
|||
Column,
|
||||
CreateDateColumn,
|
||||
ForeignKeyColumn,
|
||||
Generated,
|
||||
PrimaryGeneratedColumn,
|
||||
Table,
|
||||
Timestamp,
|
||||
Unique,
|
||||
UpdateDateColumn,
|
||||
} from 'src/sql-tools';
|
||||
|
|
@ -16,20 +18,20 @@ import {
|
|||
@UpdatedAtTrigger('asset_files_updated_at')
|
||||
export class AssetFileTable {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: string;
|
||||
id!: Generated<string>;
|
||||
|
||||
@ForeignKeyColumn(() => AssetTable, {
|
||||
onDelete: 'CASCADE',
|
||||
onUpdate: 'CASCADE',
|
||||
indexName: 'IDX_asset_files_assetId',
|
||||
})
|
||||
assetId?: string;
|
||||
assetId!: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
createdAt!: Generated<Timestamp>;
|
||||
|
||||
@UpdateDateColumn()
|
||||
updatedAt!: Date;
|
||||
updatedAt!: Generated<Timestamp>;
|
||||
|
||||
@Column()
|
||||
type!: AssetFileType;
|
||||
|
|
@ -38,5 +40,5 @@ export class AssetFileTable {
|
|||
path!: string;
|
||||
|
||||
@UpdateIdColumn({ indexName: 'IDX_asset_files_update_id' })
|
||||
updateId?: string;
|
||||
updateId!: Generated<string>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue