High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
import {
Column,
CreateDateColumn,
ForeignKeyColumn,
type Generated,
PrimaryGeneratedColumn,
Table,
Timestamp,
} from '@immich/sql-tools';
import { SharedLinkType } from 'src/enum.js';
import { AlbumTable } from 'src/schema/tables/album.table.js';
import { UserTable } from 'src/schema/tables/user.table.js';
@Table('shared_link')
export class SharedLinkTable {
@PrimaryGeneratedColumn()
id!: Generated<string>;
@Column({ type: 'character varying', nullable: true })
description!: string | null;
@ForeignKeyColumn(() => UserTable, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
userId!: string;
@Column({ type: 'bytea', index: true, unique: true })
key!: Buffer; // use to access the individual asset
@Column()
type!: SharedLinkType;
@CreateDateColumn()
createdAt!: Generated<Timestamp>;
@Column({ type: 'timestamp with time zone', nullable: true })
expiresAt!: Timestamp | null;
@Column({ type: 'boolean', default: false })
allowUpload!: boolean;
@ForeignKeyColumn(() => AlbumTable, { nullable: true, onDelete: 'CASCADE', onUpdate: 'CASCADE' })
albumId!: string | null;
@Column({ type: 'boolean', default: true })
allowDownload!: Generated<boolean>;
@Column({ type: 'boolean', default: true })
showExif!: Generated<boolean>;
@Column({ type: 'character varying', nullable: true })
password!: string | null;
@Column({ type: 'character varying', nullable: true, unique: true })
slug!: string | null;
}