typeorm#CreateDateColumn TypeScript Examples

The following examples show how to use typeorm#CreateDateColumn. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: abstract.entity.ts    From life-helper-backend with MIT License 6 votes vote down vote up
/**
   * 创建时间
   *
   *
   * ### 说明
   *
   * ```markdown
   * 1. `创建时间` 列由 MySQL 触发器自动维护,禁止在代码中手动更新。
   * ```
   */
  @CreateDateColumn({
    name: 'create_time',
    select: false,
    update: false,
    insert: false,
    comment: '创建时间',
  })
  createTime: Date
Example #2
Source File: base.entity.ts    From nestjs-starter with MIT License 6 votes vote down vote up
/**
 * This abstract function includes CreatedAt && UpdatedAt timestamps can attach another class as parameter
 * @param Base Class which plans to extends from AbstractBase
 */
export function EntityBaseWithDate<TBase extends Constructor>(Base: TBase) {
  abstract class AbstractBase extends Base {
    @CreateDateColumn({
      name: 'created_at',
      type: 'timestamp',
      nullable: true,
      default: () => 'CURRENT_TIMESTAMP(6)',
    })
    createdAt: Date;

    @UpdateDateColumn({
      name: 'updated_at',
      type: 'timestamp',
      default: () => 'CURRENT_TIMESTAMP(6)',
      onUpdate: 'CURRENT_TIMESTAMP(6)',
    })
    updatedAt: Date;
  }

  return AbstractBase;
}
Example #3
Source File: card.entity.ts    From 42_checkIn with GNU General Public License v3.0 5 votes vote down vote up
@CreateDateColumn()
  private createdAt: Date;
Example #4
Source File: Alert.ts    From bluebubbles-server with Apache License 2.0 5 votes vote down vote up
@CreateDateColumn()
    created: Date;
Example #5
Source File: userComments.ts    From Corsace with MIT License 5 votes vote down vote up
@CreateDateColumn()
    createdAt!: Date;
Example #6
Source File: base-page.entity.ts    From Cromwell with MIT License 5 votes vote down vote up
@Field(() => CustomDateScalar, { nullable: true })
    @CreateDateColumn()
    @Index()
    createDate?: Date | null;
Example #7
Source File: Image.ts    From NLW-3.0 with MIT License 5 votes vote down vote up
@CreateDateColumn()
	created_at: Date;
Example #8
Source File: Application.ts    From Designer-Server with GNU General Public License v3.0 5 votes vote down vote up
@Column()
  @CreateDateColumn({ type: "timestamp" })
  createdAt: Date;
Example #9
Source File: Appointment.ts    From gobarber-api with MIT License 5 votes vote down vote up
@CreateDateColumn()
  created_at: Date;
Example #10
Source File: Category.ts    From rocketseat-gostack-11-desafios with MIT License 5 votes vote down vote up
@CreateDateColumn()
  created_at: Date;
Example #11
Source File: Post.ts    From jaebook-server with MIT License 5 votes vote down vote up
@CreateDateColumn({ name: "created_at" })
  createdAt: Date;
Example #12
Source File: Appointment.ts    From hotseat-api with MIT License 5 votes vote down vote up
@CreateDateColumn({ type: 'timestamp' })
  created_at: Date;
Example #13
Source File: generic.entity.ts    From NestJs-youtube with MIT License 5 votes vote down vote up
@CreateDateColumn({ default: () => 'CURRENT_TIMESTAMP', type: 'timestamp' })
  // tslint:disable-next-line: variable-name
  created_at: Date;
Example #14
Source File: ModelBase.ts    From barista with Apache License 2.0 5 votes vote down vote up
@ApiProperty()
  @CreateDateColumn({ name: 'created_at', nullable: false })
  createdAt: Date;
Example #15
Source File: typeorm.entity.base.ts    From domain-driven-hexagon with MIT License 5 votes vote down vote up
@CreateDateColumn({
    type: 'timestamptz',
    update: false,
  })
  createdAt: Date;
Example #16
Source File: custom.entity.ts    From adminjs-upload with MIT License 5 votes vote down vote up
@CreateDateColumn()
  public createdAt: Date;
Example #17
Source File: Item.ts    From ecoleta with MIT License 5 votes vote down vote up
@CreateDateColumn()
  created_at: Date;
Example #18
Source File: user.entity.ts    From svvs with MIT License 5 votes vote down vote up
/**
   * User creation date (autogenerate)
   */
  @CreateDateColumn()
  created: string;
Example #19
Source File: alerts.entity.ts    From prism-frontend with MIT License 5 votes vote down vote up
@CreateDateColumn()
  createdAt: Date;
Example #20
Source File: CashResource.ts    From cashcash-desktop with MIT License 5 votes vote down vote up
@CreateDateColumn({ name: 'createdDate' })
    createdDate: Date;
Example #21
Source File: Class.ts    From Project-template-TS with Apache License 2.0 5 votes vote down vote up
@CreateDateColumn({ name: 'created_At' })
  createdAt: Date;
Example #22
Source File: user.entity.ts    From nest-js-quiz-manager with MIT License 5 votes vote down vote up
@ApiProperty({ description: 'When user was created' })
  @CreateDateColumn()
  createdAt: Date;
Example #23
Source File: Content.ts    From Typescript_TypeORM with Apache License 2.0 5 votes vote down vote up
@CreateDateColumn({ name: 'created_At' })
  createdAt: Date;
Example #24
Source File: site-audit.entity.ts    From aqualink-app with MIT License 5 votes vote down vote up
@Index()
  @CreateDateColumn()
  createdAt: Date;
Example #25
Source File: branch.entity.ts    From typeorm-query-builder-wrapper with MIT License 5 votes vote down vote up
@CreateDateColumn({
    type: 'timestamp',
    name: 'create_date_time',
  })
  createDateTime: Date;
Example #26
Source File: User.ts    From test with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@CreateDateColumn()
  createdAt: Date
Example #27
Source File: ApiKey.ts    From avalanche-faucet-legacy with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@CreateDateColumn({type: 'timestamp'})
    createdAt!: string;
Example #28
Source File: Post.ts    From lireddit with MIT License 5 votes vote down vote up
@Field(() => String)
  @CreateDateColumn()
  createdAt: Date;
Example #29
Source File: Message.ts    From vsinder with Apache License 2.0 5 votes vote down vote up
@CreateDateColumn({
    type: "timestamp with time zone",
    transformer: { from: (a) => a.getTime(), to: (a) => a },
  })
  createdAt: Date;