mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
fix timestamp with ms and some wrong usage of CreateDateColumn
This commit is contained in:
parent
1a42838a94
commit
30a52687a8
@ -38,11 +38,7 @@ export class Account {
|
||||
@Column({ type: 'tinyint', unsigned: true })
|
||||
type: number
|
||||
|
||||
@CreateDateColumn({
|
||||
name: 'created_at',
|
||||
type: 'datetime',
|
||||
default: () => 'CURRENT_TIMESTAMP',
|
||||
})
|
||||
@CreateDateColumn({ name: 'created_at', type: 'datetime', default: () => 'CURRENT_TIMESTAMP(3)' })
|
||||
createdAt: Date
|
||||
|
||||
@Column({ name: 'confirmed_at', type: 'datetime', nullable: true })
|
||||
@ -57,7 +53,11 @@ export class Account {
|
||||
})
|
||||
balance: Decimal
|
||||
|
||||
@Column({ name: 'balance_date', type: 'datetime' })
|
||||
@Column({
|
||||
name: 'balance_date',
|
||||
type: 'datetime',
|
||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
||||
})
|
||||
balanceDate: Date
|
||||
|
||||
@ManyToMany(() => Community, (community) => community.communityAccounts)
|
||||
|
||||
@ -46,7 +46,7 @@ export class Community {
|
||||
@JoinColumn({ name: 'auf_account_id' })
|
||||
aufAccount?: Account
|
||||
|
||||
@CreateDateColumn({ name: 'created_at', type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
||||
@CreateDateColumn({ name: 'created_at', type: 'datetime', default: () => 'CURRENT_TIMESTAMP(3)' })
|
||||
createdAt: Date
|
||||
|
||||
@Column({ name: 'confirmed_at', type: 'datetime', nullable: true })
|
||||
|
||||
@ -1,12 +1,4 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
} from 'typeorm'
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, OneToOne } from 'typeorm'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
|
||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
||||
@ -52,6 +44,6 @@ export class ConfirmedTransaction {
|
||||
@Column({ name: 'iota_milestone', type: 'bigint' })
|
||||
iotaMilestone: number
|
||||
|
||||
@CreateDateColumn({ name: 'confirmed_at', type: 'datetime' })
|
||||
@Column({ name: 'confirmed_at', type: 'datetime' })
|
||||
confirmedAt: Date
|
||||
}
|
||||
|
||||
@ -1,4 +1,12 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToMany, JoinColumn } from 'typeorm'
|
||||
import {
|
||||
BaseEntity,
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
OneToMany,
|
||||
JoinColumn,
|
||||
CreateDateColumn,
|
||||
} from 'typeorm'
|
||||
|
||||
import { Account } from './Account'
|
||||
|
||||
@ -18,7 +26,7 @@ export class User extends BaseEntity {
|
||||
@Column({ name: 'derive1_pubkey', type: 'binary', length: 32, unique: true })
|
||||
derive1Pubkey: Buffer
|
||||
|
||||
@Column({
|
||||
@CreateDateColumn({
|
||||
name: 'created_at',
|
||||
type: 'datetime',
|
||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user