update transaction_id to not nullable

This commit is contained in:
einhorn_b 2023-12-29 15:16:43 +01:00
parent 374f3cd7eb
commit 4c178ec92a
2 changed files with 4 additions and 4 deletions

View File

@ -14,10 +14,10 @@ export class BackendTransaction extends BaseEntity {
@ManyToOne(() => Transaction, (transaction) => transaction.backendTransactions)
@JoinColumn({ name: 'transaction_id' })
transaction?: Transaction
transaction: Transaction
@Column({ name: 'transaction_id', type: 'bigint', unsigned: true, nullable: true })
transactionId?: number
@Column({ name: 'transaction_id', type: 'bigint', unsigned: true })
transactionId: number
@Column({ name: 'type_id', unsigned: true, nullable: false })
typeId: number

View File

@ -65,7 +65,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
`CREATE TABLE \`backend_transactions\` (
\`id\` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
\`backend_transaction_id\` BIGINT UNSIGNED NOT NULL,
\`transaction_id\` BIGINT UNSIGNED NULL DEFAULT NULL,
\`transaction_id\` BIGINT UNSIGNED NOT NULL,
\`type_id\` INT UNSIGNED NOT NULL,
\`balance\` DECIMAL(40, 20) NULL DEFAULT NULL,
\`created_at\` DATETIME(3) NOT NULL,