mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
postgres init
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
import { Column, Entity, Index, PrimaryColumn } from 'typeorm';
|
||||
|
||||
import { DateTimeTransformer } from '../utils/DateTimeTransformer';
|
||||
import { TrackedEntity } from '../utils/TrackedEntity.entity';
|
||||
|
||||
//https://www.sqlite.org/withoutrowid.html
|
||||
|
||||
//The WITHOUT ROWID optimization is likely to be helpful for tables that have non-integer
|
||||
// or composite (multi-column) PRIMARY KEYs and that do not store large strings or BLOBs.
|
||||
//WITHOUT ROWID tables work best when individual rows are not too large.
|
||||
@Entity({ withoutRowid: true })
|
||||
@Entity()
|
||||
@Index(['address', 'clientName', 'sessionId'], { unique: true })
|
||||
export class ClientEntity extends TrackedEntity {
|
||||
|
||||
@@ -28,13 +23,13 @@ export class ClientEntity extends TrackedEntity {
|
||||
|
||||
|
||||
|
||||
@Column({ type: 'datetime', transformer: new DateTimeTransformer() })
|
||||
@Column({ type: 'timestamp' })
|
||||
startTime: Date;
|
||||
|
||||
@Column({ type: 'real', default: 0 })
|
||||
@Column({ type: 'decimal', default: 0 })
|
||||
bestDifficulty: number
|
||||
|
||||
@Column({ default: 0 })
|
||||
@Column({ default: 0, type: 'decimal' })
|
||||
hashRate: number;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user