epic_explorer/server/entities/BlockchainInput.ts

41 lines
768 B
TypeScript
Raw Normal View History

2019-07-09 09:22:36 +00:00
import {
Column,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { BlockchainBlock } from './BlockchainBlock';
@Entity('blockchain_input', { schema: 'public' })
export class BlockchainInput {
@PrimaryGeneratedColumn({
type: 'integer',
name: 'id',
})
Id: number;
@Column('character varying', {
nullable: false,
length: 66,
name: 'data',
})
Data: string;
@Column('character varying', {
nullable: false,
primary: true,
length: 64,
name: 'block_id',
})
BlockId: string;
@ManyToOne(
type => BlockchainBlock,
blockchain_block => blockchain_block.BlockchainInputs,
{ nullable: false },
)
@JoinColumn({ name: 'block_id' })
Block: BlockchainBlock | null;
}