How to use the sequelize-typescript.DataType.DATE function in sequelize-typescript

To help you get started, we’ve selected a few sequelize-typescript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github T-Systems-RUS / Portfolio / server / models / Program.ts View on Github external
@Column
  lineId: number;

  @BelongsTo(() => Line)
  line: Line;

  @CreatedAt
  @Column({
    type: DataType.DATE,
    defaultValue: DataType.NOW
  })
  createdAt: Date;

  @UpdatedAt
  @Column({
    type: DataType.DATE,
    defaultValue: DataType.NOW
  })
  updatedAt: Date;

  @HasMany(() => Project)
  projects: Project[];

}
github T-Systems-RUS / Portfolio / server / models / Customer.ts View on Github external
})
export class Customer extends Model {

  @AllowNull(false)
  @Column
  name: string;

  @Column
  active: boolean;

  @Column
  image: string;

  @CreatedAt
  @Column({
    type: DataType.DATE,
    defaultValue: DataType.NOW
  })
  createdAt: Date;

  @UpdatedAt
  @Column({
    type: DataType.DATE,
    defaultValue: DataType.NOW
  })
  updatedAt: Date;

  @ForeignKey(() => Domain)
  @Column
  domainId: number;

  @BelongsTo(() => Domain)
github T-Systems-RUS / Portfolio / server / models / Program.ts View on Github external
name: string;

  @Column
  active: boolean;

  @AllowNull(false)
  @ForeignKey(() => Line)
  @Column
  lineId: number;

  @BelongsTo(() => Line)
  line: Line;

  @CreatedAt
  @Column({
    type: DataType.DATE,
    defaultValue: DataType.NOW
  })
  createdAt: Date;

  @UpdatedAt
  @Column({
    type: DataType.DATE,
    defaultValue: DataType.NOW
  })
  updatedAt: Date;

  @HasMany(() => Project)
  projects: Project[];

}
github T-Systems-RUS / Portfolio / server / models / Domain.ts View on Github external
@Table({
  timestamps: true,
  tableName: Tables.DOMAINS
})
export class Domain extends Model {

  @AllowNull(false)
  @Column
  name: string;

  @Column
  active: boolean;

  @CreatedAt
  @Column({
    type: DataType.DATE,
    defaultValue: DataType.NOW
  })
  createdAt: Date;

  @UpdatedAt
  @Column({
    type: DataType.DATE,
    defaultValue: DataType.NOW
  })
  updatedAt: Date;

  @HasMany(() => Project)
  projects: Project[];

  @HasMany(() => Customer)
  customers: Customer[];
github atlassian / nucleus / src / db / sequelize / models / index.ts View on Github external
@Table
export class TemporarySave extends Model {
  @Unique
  @Column(DataType.STRING)
  saveString: string;

  @Column(DataType.STRING)
  version: string;

  @Column(DataType.STRING)
  arch: string;

  @Column(DataType.STRING)
  platform: string;

  @Column(DataType.DATE)
  date: Date;

  @Column(DataType.STRING)
  cipherPassword: string;

  @ForeignKey(() => Channel)
  @Column(DataType.INTEGER)
  channelId: number;

  @BelongsTo(() => Channel)
  channel: Channel;

  @HasMany(() => TemporarySaveFile)
  files: TemporarySaveFile[];
}
github T-Systems-RUS / Portfolio / server / models / Domain.ts View on Github external
@Column
  name: string;

  @Column
  active: boolean;

  @CreatedAt
  @Column({
    type: DataType.DATE,
    defaultValue: DataType.NOW
  })
  createdAt: Date;

  @UpdatedAt
  @Column({
    type: DataType.DATE,
    defaultValue: DataType.NOW
  })
  updatedAt: Date;

  @HasMany(() => Project)
  projects: Project[];

  @HasMany(() => Customer)
  customers: Customer[];

}
github T-Systems-RUS / Portfolio / server / models / Employee.ts View on Github external
export class Employee extends Model {

    @AllowNull(false)
    @Column
    firstname: string;

    @AllowNull(false)
    @Column
    lastname: string;

    @Column
    active: boolean;

    @CreatedAt
    @Column({
        type: DataType.DATE,
        defaultValue: DataType.NOW
    })
    createdAt: Date;

    @UpdatedAt
    @Column({
        type: DataType.DATE,
        defaultValue: DataType.NOW
    })
    updatedAt: Date;

    @HasMany(() => Schedule)
    schedules: Schedule[];

    @BelongsToMany(() => Technology, () => EmployeeTechnology)
    technologies: Technology[];
github T-Systems-RUS / Portfolio / server / models / Schedule.ts View on Github external
@Column
    roleId: number;

    @BelongsTo(() => Role)
    role: Role;

    @CreatedAt
    @Column({
        type: DataType.DATE,
        defaultValue: DataType.NOW
    })
    createdAt: Date;

    @UpdatedAt
    @Column({
        type: DataType.DATE,
        defaultValue: DataType.NOW
    })
    updatedAt: Date;
}
github T-Systems-RUS / Portfolio / server / models / Technology.ts View on Github external
@Column
    image: string;

    @Column
    version: string;

    @CreatedAt
    @Column({
        type: DataType.DATE,
        defaultValue: DataType.NOW
    })
    createdAt: Date;

    @UpdatedAt
    @Column({
        type: DataType.DATE,
        defaultValue: DataType.NOW
    })
    updatedAt: Date;

    @BelongsToMany(() => Employee, () => EmployeeTechnology)
    employees: Employee[];

    @BelongsToMany(() => Project, () => ProjectTechnology)
    projects: Project[];

}