mirror of
https://github.com/IT4Change/gradido.git
synced 2026-04-06 01:25:28 +00:00
new entity definition
This commit is contained in:
parent
345ed8a3b5
commit
8aaa6117ba
62
database/entity/0027-clean_transaction_table/Transaction.ts
Normal file
62
database/entity/0027-clean_transaction_table/Transaction.ts
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column } from 'typeorm'
|
||||||
|
|
||||||
|
@Entity('transactions')
|
||||||
|
export class Transaction extends BaseEntity {
|
||||||
|
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||||
|
id: number
|
||||||
|
|
||||||
|
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
||||||
|
userId: number
|
||||||
|
|
||||||
|
@Column({ name: 'transaction_id', unsigned: true, nullable: false })
|
||||||
|
transactionId: number
|
||||||
|
|
||||||
|
@Column({ name: 'type_id', unsigned: true, nullable: false })
|
||||||
|
typeId: number
|
||||||
|
|
||||||
|
@Column({ type: 'bigint', nullable: false })
|
||||||
|
amount: BigInt
|
||||||
|
|
||||||
|
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
memo: string
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'send_sender_final_balance',
|
||||||
|
type: 'bigint',
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
sendSenderFinalBalance: BigInt | null
|
||||||
|
|
||||||
|
@Column({ name: 'balance', type: 'bigint', default: 0 })
|
||||||
|
balance: BigInt
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'balance_date',
|
||||||
|
type: 'timestamp',
|
||||||
|
default: () => 'CURRENT_TIMESTAMP',
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
balanceDate: Date
|
||||||
|
|
||||||
|
@Column({ name: 'creation_date', type: 'timestamp', nullable: true, default: null })
|
||||||
|
creationDate: Date
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'linked_user_id',
|
||||||
|
type: 'int',
|
||||||
|
unsigned: true,
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
linkedUserId?: number | null
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'linked_transaction_id',
|
||||||
|
type: 'int',
|
||||||
|
unsigned: true,
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
linkedTransactionId?: number | null
|
||||||
|
}
|
||||||
@ -1 +1 @@
|
|||||||
export { Transaction } from './0026-combine_transaction_tables2/Transaction'
|
export { Transaction } from './0027-clean_transaction_table/Transaction'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user