mirror of
https://github.com/immich-app/immich.git
synced 2026-05-22 15:42:32 -04:00
feat: rename schema (#19891)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { UpdatedAtTrigger, UpdateIdColumn } from 'src/decorators';
|
||||
import { stacks_delete_audit } from 'src/schema/functions';
|
||||
import { stack_delete_audit } from 'src/schema/functions';
|
||||
import { AssetTable } from 'src/schema/tables/asset.table';
|
||||
import { UserTable } from 'src/schema/tables/user.table';
|
||||
import {
|
||||
@@ -13,11 +13,11 @@ import {
|
||||
UpdateDateColumn,
|
||||
} from 'src/sql-tools';
|
||||
|
||||
@Table('asset_stack')
|
||||
@UpdatedAtTrigger('stacks_updated_at')
|
||||
@Table('stack')
|
||||
@UpdatedAtTrigger('stack_updatedAt')
|
||||
@AfterDeleteTrigger({
|
||||
scope: 'statement',
|
||||
function: stacks_delete_audit,
|
||||
function: stack_delete_audit,
|
||||
referencingOldTableAs: 'old',
|
||||
when: 'pg_trigger_depth() = 0',
|
||||
})
|
||||
@@ -35,11 +35,7 @@ export class StackTable {
|
||||
updateId!: Generated<string>;
|
||||
|
||||
//TODO: Add constraint to ensure primary asset exists in the assets array
|
||||
@ForeignKeyColumn(() => AssetTable, {
|
||||
nullable: false,
|
||||
unique: true,
|
||||
uniqueConstraintName: 'REL_91704e101438fd0653f582426d',
|
||||
})
|
||||
@ForeignKeyColumn(() => AssetTable, { nullable: false, unique: true })
|
||||
primaryAssetId!: string;
|
||||
|
||||
@ForeignKeyColumn(() => UserTable, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
|
||||
|
||||
Reference in New Issue
Block a user