import { Column, DataType, ForeignKey, HasMany, Model, Table } from 'sequelize-typescript'; import { Address } from './address'; import { CoinContractAddress } from './coinContractAddress'; import { SwapMultiple } from './swapMultiple'; import { Tx } from './tx'; @Table export class SwapChain extends Model { @Column(DataType.INTEGER) chainNumber: number; @Column(DataType.STRING) chainName: string; @ForeignKey(() => Address) @Column({ type: DataType.INTEGER, allowNull: true }) fromAddressId: number; @Column({ type: DataType.BOOLEAN, defaultValue: true }) status: boolean; @ForeignKey(() => Tx) @Column({ type: DataType.INTEGER, allowNull: true }) txId: number; @HasMany(() => SwapMultiple) swap: SwapMultiple[]; @HasMany(() => CoinContractAddress) coin: CoinContractAddress[]; }