epic_explorer/server/entities/BlockchainInput.ts
2019-07-16 11:47:19 +05:30

41 lines
768 B
TypeScript

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;
}