mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
correct old entity models which were defined incompletely or wrong
This commit is contained in:
parent
4d1277b60d
commit
4396080ef5
@ -1,25 +1,34 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne } from 'typeorm'
|
||||
import { TransactionCreation } from './TransactionCreation'
|
||||
import { TransactionSendCoin } from './TransactionSendCoin'
|
||||
import { TransactionCreation } from '../TransactionCreation'
|
||||
import { TransactionSendCoin } from '../TransactionSendCoin'
|
||||
|
||||
@Entity('transactions')
|
||||
export class Transaction extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
|
||||
@Column({ name: 'transaction_type_id' })
|
||||
@Column({ name: 'state_group_id', unsigned: true, default: null })
|
||||
stateGroupId: number
|
||||
|
||||
@Column({ name: 'transaction_type_id', unsigned: true, nullable: false })
|
||||
transactionTypeId: number
|
||||
|
||||
@Column({ name: 'tx_hash', type: 'binary', length: 48 })
|
||||
@Column({ name: 'tx_hash', type: 'binary', length: 48, default: null })
|
||||
txHash: Buffer
|
||||
|
||||
@Column()
|
||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||
memo: string
|
||||
|
||||
@Column({ type: 'timestamp' })
|
||||
@Column({ type: 'timestamp', nullable: false, default: () => 'CURRENT_TIMESTAMP' })
|
||||
received: Date
|
||||
|
||||
@Column({ name: 'blockchain_type_id' })
|
||||
@Column({
|
||||
name: 'blockchain_type_id',
|
||||
type: 'bigint',
|
||||
unsigned: true,
|
||||
nullable: false,
|
||||
default: 1,
|
||||
})
|
||||
blockchainTypeId: number
|
||||
|
||||
@OneToOne(() => TransactionSendCoin, (transactionSendCoin) => transactionSendCoin.transaction)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm'
|
||||
import { Transaction } from './Transaction'
|
||||
import { Transaction } from '../Transaction'
|
||||
|
||||
@Entity('transaction_creations')
|
||||
export class TransactionCreation extends BaseEntity {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm'
|
||||
import { Transaction } from './Transaction'
|
||||
import { Transaction } from '../Transaction'
|
||||
|
||||
@Entity('transaction_send_coins')
|
||||
export class TransactionSendCoin extends BaseEntity {
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm'
|
||||
import { Transaction } from './Transaction'
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm'
|
||||
import { Transaction } from '../Transaction'
|
||||
|
||||
@Entity('transaction_signatures')
|
||||
export class TransactionSignature extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||
id: number
|
||||
|
||||
@Column({ name: 'transaction_id' })
|
||||
transactionId: number
|
||||
|
||||
@Column({ type: 'binary', length: 64 })
|
||||
@Column({ type: 'binary', length: 64, nullable: false })
|
||||
signature: Buffer
|
||||
|
||||
@Column({ type: 'binary', length: 32 })
|
||||
@Column({ type: 'binary', length: 32, nullable: false })
|
||||
pubkey: Buffer
|
||||
|
||||
@ManyToOne(() => Transaction)
|
||||
@OneToOne(() => Transaction)
|
||||
@JoinColumn({ name: 'transaction_id' })
|
||||
transaction: Transaction
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm'
|
||||
import { UserSetting } from './UserSetting'
|
||||
import { UserSetting } from '../UserSetting'
|
||||
|
||||
// Moriz: I do not like the idea of having two user tables
|
||||
@Entity('state_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm'
|
||||
import { User } from './User'
|
||||
import { User } from '../User'
|
||||
|
||||
@Entity()
|
||||
export class UserSetting extends BaseEntity {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user