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