mirror of
https://github.com/immich-app/immich.git
synced 2025-12-17 17:23:20 +03:00
refactor: database column names (#23356)
This commit is contained in:
@@ -32,7 +32,7 @@ import {
|
||||
@ForeignKeyConstraint({
|
||||
columns: ['albumId', 'assetId'],
|
||||
referenceTable: () => AlbumAssetTable,
|
||||
referenceColumns: ['albumsId', 'assetsId'],
|
||||
referenceColumns: ['albumId', 'assetId'],
|
||||
onUpdate: 'NO ACTION',
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
|
||||
@@ -22,10 +22,10 @@ import {
|
||||
})
|
||||
export class AlbumAssetTable {
|
||||
@ForeignKeyColumn(() => AlbumTable, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: false, primary: true })
|
||||
albumsId!: string;
|
||||
albumId!: string;
|
||||
|
||||
@ForeignKeyColumn(() => AssetTable, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: false, primary: true })
|
||||
assetsId!: string;
|
||||
assetId!: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Generated<Timestamp>;
|
||||
|
||||
@@ -37,7 +37,7 @@ export class AlbumUserTable {
|
||||
nullable: false,
|
||||
primary: true,
|
||||
})
|
||||
albumsId!: string;
|
||||
albumId!: string;
|
||||
|
||||
@ForeignKeyColumn(() => UserTable, {
|
||||
onDelete: 'CASCADE',
|
||||
@@ -45,7 +45,7 @@ export class AlbumUserTable {
|
||||
nullable: false,
|
||||
primary: true,
|
||||
})
|
||||
usersId!: string;
|
||||
userId!: string;
|
||||
|
||||
@Column({ type: 'character varying', default: AlbumUserRole.Editor })
|
||||
role!: Generated<AlbumUserRole>;
|
||||
|
||||
@@ -25,7 +25,7 @@ export class MemoryAssetTable {
|
||||
memoriesId!: string;
|
||||
|
||||
@ForeignKeyColumn(() => AssetTable, { onUpdate: 'CASCADE', onDelete: 'CASCADE', primary: true })
|
||||
assetsId!: string;
|
||||
assetId!: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Generated<Timestamp>;
|
||||
|
||||
@@ -5,8 +5,8 @@ import { ForeignKeyColumn, Table } from 'src/sql-tools';
|
||||
@Table('shared_link_asset')
|
||||
export class SharedLinkAssetTable {
|
||||
@ForeignKeyColumn(() => AssetTable, { onUpdate: 'CASCADE', onDelete: 'CASCADE', primary: true })
|
||||
assetsId!: string;
|
||||
assetId!: string;
|
||||
|
||||
@ForeignKeyColumn(() => SharedLinkTable, { onUpdate: 'CASCADE', onDelete: 'CASCADE', primary: true })
|
||||
sharedLinksId!: string;
|
||||
sharedLinkId!: string;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@ import { AssetTable } from 'src/schema/tables/asset.table';
|
||||
import { TagTable } from 'src/schema/tables/tag.table';
|
||||
import { ForeignKeyColumn, Index, Table } from 'src/sql-tools';
|
||||
|
||||
@Index({ columns: ['assetsId', 'tagsId'] })
|
||||
@Index({ columns: ['assetId', 'tagId'] })
|
||||
@Table('tag_asset')
|
||||
export class TagAssetTable {
|
||||
@ForeignKeyColumn(() => AssetTable, { onUpdate: 'CASCADE', onDelete: 'CASCADE', primary: true, index: true })
|
||||
assetsId!: string;
|
||||
assetId!: string;
|
||||
|
||||
@ForeignKeyColumn(() => TagTable, { onUpdate: 'CASCADE', onDelete: 'CASCADE', primary: true, index: true })
|
||||
tagsId!: string;
|
||||
tagId!: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user