fix typeorm timestamps
This commit is contained in:
parent
c78af3f7dc
commit
9e68698ddc
@ -34,7 +34,7 @@ async function bootstrap() {
|
|||||||
saveUninitialized: false,
|
saveUninitialized: false,
|
||||||
store: new RedisStore({ client: redisClient }),
|
store: new RedisStore({ client: redisClient }),
|
||||||
cookie: {
|
cookie: {
|
||||||
sameSite: 'lax',
|
sameSite: 'strict',
|
||||||
secure: process.env.NODE_ENV === 'production',
|
secure: process.env.NODE_ENV === 'production',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
@ -22,17 +22,10 @@ export class Document {
|
|||||||
@Column({ type: 'text', nullable: false })
|
@Column({ type: 'text', nullable: false })
|
||||||
body: string;
|
body: string;
|
||||||
|
|
||||||
@CreateDateColumn({
|
@CreateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public created_at: Date;
|
public created_at: Date;
|
||||||
|
|
||||||
@UpdateDateColumn({
|
@UpdateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public updated_at: Date;
|
public updated_at: Date;
|
||||||
|
|
||||||
@ManyToOne(() => User)
|
@ManyToOne(() => User)
|
||||||
|
@ -19,10 +19,7 @@ export class OAuth2ClientAuthorization {
|
|||||||
@Column({ type: 'timestamp' })
|
@Column({ type: 'timestamp' })
|
||||||
public expires_at: Date;
|
public expires_at: Date;
|
||||||
|
|
||||||
@CreateDateColumn({
|
@CreateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public created_at: Date;
|
public created_at: Date;
|
||||||
|
|
||||||
@ManyToOne(() => OAuth2Client)
|
@ManyToOne(() => OAuth2Client)
|
||||||
|
@ -41,17 +41,10 @@ export class OAuth2Client {
|
|||||||
@Column({ default: false })
|
@Column({ default: false })
|
||||||
verified: boolean;
|
verified: boolean;
|
||||||
|
|
||||||
@CreateDateColumn({
|
@CreateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public created_at: Date;
|
public created_at: Date;
|
||||||
|
|
||||||
@UpdateDateColumn({
|
@UpdateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public updated_at: Date;
|
public updated_at: Date;
|
||||||
|
|
||||||
@ManyToOne(() => Upload, { nullable: true, onDelete: 'SET NULL' })
|
@ManyToOne(() => Upload, { nullable: true, onDelete: 'SET NULL' })
|
||||||
|
@ -38,16 +38,9 @@ export class OAuth2Token {
|
|||||||
@Column({ type: 'timestamp' })
|
@Column({ type: 'timestamp' })
|
||||||
public expires_at: Date;
|
public expires_at: Date;
|
||||||
|
|
||||||
@CreateDateColumn({
|
@CreateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public created_at: Date;
|
public created_at: Date;
|
||||||
|
|
||||||
@UpdateDateColumn({
|
@UpdateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public updated_at: Date;
|
public updated_at: Date;
|
||||||
}
|
}
|
||||||
|
@ -29,16 +29,9 @@ export class Upload {
|
|||||||
})
|
})
|
||||||
uploader: User;
|
uploader: User;
|
||||||
|
|
||||||
@CreateDateColumn({
|
@CreateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public created_at: Date;
|
public created_at: Date;
|
||||||
|
|
||||||
@UpdateDateColumn({
|
@UpdateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public updated_at: Date;
|
public updated_at: Date;
|
||||||
}
|
}
|
||||||
|
@ -32,10 +32,7 @@ export class UserToken {
|
|||||||
@Column({ type: 'timestamp', nullable: true })
|
@Column({ type: 'timestamp', nullable: true })
|
||||||
public expires_at: Date;
|
public expires_at: Date;
|
||||||
|
|
||||||
@CreateDateColumn({
|
@CreateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public created_at: Date;
|
public created_at: Date;
|
||||||
|
|
||||||
@ManyToOne(() => User)
|
@ManyToOne(() => User)
|
||||||
|
@ -37,17 +37,10 @@ export class User {
|
|||||||
@Column({ type: 'timestamp' })
|
@Column({ type: 'timestamp' })
|
||||||
public activity_at: Date;
|
public activity_at: Date;
|
||||||
|
|
||||||
@CreateDateColumn({
|
@CreateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public created_at: Date;
|
public created_at: Date;
|
||||||
|
|
||||||
@UpdateDateColumn({
|
@UpdateDateColumn()
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(6)',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(6)',
|
|
||||||
})
|
|
||||||
public updated_at: Date;
|
public updated_at: Date;
|
||||||
|
|
||||||
@ManyToOne(() => Upload, {
|
@ManyToOne(() => Upload, {
|
||||||
|
Reference in New Issue
Block a user