mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
Add payout modes and production switchover schema
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
import { PayoutMode } from '../../types/payout-mode';
|
||||
|
||||
const bigintTransformer = {
|
||||
from: (value: string | number | null): number => Number(value ?? 0),
|
||||
to: (value: number): number => Math.trunc(value ?? 0),
|
||||
};
|
||||
|
||||
@Entity({ name: 'payout_history' })
|
||||
@Index('UQ_payout_history_block_address', ['blockHeight', 'address'], { unique: true })
|
||||
@Index('UQ_payout_history_block_address', ['payoutMode', 'blockHeight', 'address'], { unique: true })
|
||||
@Index('IDX_payout_history_address_created', ['address', 'createdAt'])
|
||||
export class PayoutHistoryEntity {
|
||||
@PrimaryGeneratedColumn({ type: 'bigint' })
|
||||
@@ -18,6 +20,9 @@ export class PayoutHistoryEntity {
|
||||
@Column({ type: 'bigint' })
|
||||
payoutSnapshotId: string;
|
||||
|
||||
@Column({ length: 16, type: 'varchar', default: 'pplns' })
|
||||
payoutMode: PayoutMode;
|
||||
|
||||
@Column({ length: 62, type: 'varchar' })
|
||||
address: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user