Skip to content

Commit

Permalink
remove unused validation decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Aug 25, 2023
1 parent b4bca90 commit 3a6c207
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions packages/cli/src/databases/entities/AbstractEntity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { ColumnOptions } from 'typeorm';
import { BeforeInsert, BeforeUpdate, Column, PrimaryColumn } from 'typeorm';
import { IsOptional } from 'class-validator';
import config from '@/config';
import { generateNanoId } from '../utils/generators';

Expand Down Expand Up @@ -42,14 +41,12 @@ function mixinStringId<T extends Constructor<{}>>(base: T) {
function mixinTimestamps<T extends Constructor<{}>>(base: T) {
class Derived extends base {
@Column(tsColumnOptions)
@IsOptional() // ignored by validation because set at DB level
createdAt: Date;

@Column({
...tsColumnOptions,
onUpdate: timestampSyntax,
})
@IsOptional() // ignored by validation because set at DB level
updatedAt: Date;

@BeforeUpdate()
Expand Down

0 comments on commit 3a6c207

Please sign in to comment.