import { Column , Index } from 'typeorm' ; import { ColumnCommonOptions } from 'typeorm/decorator/options/ColumnCommonOptions' ; import { ColumnWithWidthOptions } from 'typeorm/decorator/options/ColumnWithWidthOptions' ; import { AnyConstructor } from '@mds-core/mds-types' ; import { BigintTransformer } from '../transformers' ; import { Mixin } from '../@types' ; export const IdentityColumn = < T extends AnyConstructor > ( EntityClass , options = { } ) => { abstract class IdentityColumnMixin extends EntityClass { @ Column ( 'bigint' , { generated : 'increment' , transformer : BigintTransformer , ... options } ) @ Index ( { unique : true } ) id : number ; } return IdentityColumnMixin ; } ; export type IdentityColumn = Mixin < typeof IdentityColumn > ;