mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
make backendTransactionId unique
This commit is contained in:
parent
3b6240de1f
commit
374f3cd7eb
@ -9,8 +9,8 @@ export class BackendTransaction extends BaseEntity {
|
||||
@PrimaryGeneratedColumn('increment', { unsigned: true, type: 'bigint' })
|
||||
id: number
|
||||
|
||||
@Column({ name: 'backend_transaction_id', type: 'bigint', unsigned: true, nullable: true })
|
||||
backendTransactionId?: number
|
||||
@Column({ name: 'backend_transaction_id', type: 'bigint', unsigned: true, unique: true })
|
||||
backendTransactionId: number
|
||||
|
||||
@ManyToOne(() => Transaction, (transaction) => transaction.backendTransactions)
|
||||
@JoinColumn({ name: 'transaction_id' })
|
||||
|
||||
@ -72,6 +72,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
|
||||
\`confirmed_at\` DATETIME NULL DEFAULT NULL,
|
||||
\`verifiedOnBackend\` TINYINT NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (\`id\`),
|
||||
UNIQUE (\`backend_transaction_id\`),
|
||||
FOREIGN KEY (\`transaction_id\`) REFERENCES transactions(id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
`,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user