How to use the sequelize-typescript.DataType.NOW 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 / Schedule.ts View on Github external
@BelongsTo(() => Employee)
    employee: Employee;

    // Role
    @ForeignKey(() => Role)
    @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 / Program.ts View on Github external
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
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 T-Systems-RUS / Portfolio / server / models / Customer.ts View on Github external
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)
  domain: Domain;

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

}
github T-Systems-RUS / Portfolio / server / models / Schedule.ts View on Github external
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 / Employee.ts View on Github external
@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 / Technology.ts View on Github external
@Column
    domain: string;

    @Column
    active: boolean;

    @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[];
github T-Systems-RUS / Portfolio / server / models / Role.ts View on Github external
@Column
    domain: string;

    @Column
    leadrole: boolean;

    @Column
    seniority: 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[];

}
github T-Systems-RUS / Portfolio / server / models / Project.ts View on Github external
@Column({
        type: DataType.DATE
    })
    enddate: Date;

    @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, () => ProjectTechnology)
    technologies: Technology[];

    @BelongsToMany(() => Customer, () => ProjectCustomer)
    customers: Customer[];

}
github T-Systems-RUS / Portfolio / server / models / Employee.ts View on Github external
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[];

}