mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
add invalid transaction table
This commit is contained in:
parent
f432d1269d
commit
af80bd56ff
@ -5,7 +5,6 @@ import {
|
||||
CreateDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
OneToMany,
|
||||
ManyToMany,
|
||||
JoinTable,
|
||||
@ -15,7 +14,7 @@ import { Community } from './Community'
|
||||
import { TransactionRecipe } from './TransactionRecipe'
|
||||
import { ConfirmedTransaction } from './ConfirmedTransaction'
|
||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
||||
import Decimal from 'decimal.js-light'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
|
||||
@Entity('accounts')
|
||||
export class Account {
|
||||
|
||||
10
dlt-database/entity/0001-init_db/InvalidTransaction.ts
Normal file
10
dlt-database/entity/0001-init_db/InvalidTransaction.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'
|
||||
|
||||
@Entity('invalid_transactions')
|
||||
export class InvalidTransaction {
|
||||
@PrimaryGeneratedColumn('increment', { unsigned: true, type: 'bigint' })
|
||||
id: number
|
||||
|
||||
@Column({ name: 'iota_message_id', type: 'binary', length: 32, nullable: true })
|
||||
iotaMessageId?: Buffer
|
||||
}
|
||||
1
dlt-database/entity/InvalidTransaction.ts
Normal file
1
dlt-database/entity/InvalidTransaction.ts
Normal file
@ -0,0 +1 @@
|
||||
export { InvalidTransaction } from './0001-init_db/InvalidTransaction'
|
||||
@ -108,6 +108,14 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
|
||||
FOREIGN KEY (\`transaction_recipe_id\`) REFERENCES transaction_recipes(id),
|
||||
FOREIGN KEY (\`account_id\`) REFERENCES accounts(id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;`)
|
||||
|
||||
await queryFn(`
|
||||
CREATE TABLE IF NOT EXISTS \`invalid_transactions\` (
|
||||
\`id\` bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
\`iota_message_id\` binary(32) DEFAULT NULL,
|
||||
PRIMARY KEY (\`id\`),
|
||||
INDEX (\`iota_message_id\`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;`)
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
@ -118,4 +126,5 @@ export async function downgrade(queryFn: (query: string, values?: any[]) => Prom
|
||||
await queryFn(`DROP TABLE IF EXISTS \`transaction_recipes\`;`)
|
||||
await queryFn(`DROP TABLE IF EXISTS \`confirmed_transactions\`;`)
|
||||
await queryFn(`DROP TABLE IF EXISTS \`community\`;`)
|
||||
await queryFn(`DROP TABLE IF EXISTS \`invalid_transactions\`;`)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user