26 lines
491 B
TypeScript
26 lines
491 B
TypeScript
import {
|
|
Column,
|
|
Entity,
|
|
ManyToOne,
|
|
PrimaryGeneratedColumn,
|
|
Unique,
|
|
} from 'typeorm';
|
|
import { Bid } from './bid.entity';
|
|
import { Timestamp } from './timestamp';
|
|
|
|
@Entity('bid_metadata')
|
|
@Unique(['key_name', 'bid'])
|
|
export class BidMetadata extends Timestamp {
|
|
@PrimaryGeneratedColumn('increment')
|
|
id: number;
|
|
|
|
@Column()
|
|
key_name: string;
|
|
|
|
@Column({ type: 'json' })
|
|
value: string;
|
|
|
|
@ManyToOne(() => Bid, (bid) => bid.metadata, { onDelete: 'CASCADE' })
|
|
bid: Bid;
|
|
}
|