import { BelongsTo, Column, DataType, Default, ForeignKey, Index, Model, Table, } from 'sequelize-typescript'; import { Coin } from '../coin'; @Table({ defaultScope: { attributes: { exclude: ['createdAt', 'updatedAt'], }, }, }) export class History_1d extends Model { @Index({ name: 'history1d-timestamp-index', using: 'BTREE', }) @Column(DataType.DECIMAL) timestamp: string; @Index({ name: 'history1d-symbol-index', using: 'HASH', }) @ForeignKey(() => Coin) @Column(DataType.INTEGER) coinId: number; @Column(DataType.DECIMAL) price: string; @Column(DataType.DECIMAL) volume24: string; @Column(DataType.DECIMAL) circulating_supply: string; @Column(DataType.DECIMAL) total_supply: string; @Default('0') @Column(DataType.DECIMAL) delegated: string; @Default('0') @Column(DataType.DECIMAL) delegated24: string; @BelongsTo(() => Coin) coin: Coin; }