How to use the sequelize-typescript.DataType.INTEGER 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 birkir / prime / packages / prime-core / src / models / WebhookCall.ts View on Github external
import { Webhook } from './Webhook';

@Table
export class WebhookCall extends Model {
  @PrimaryKey
  @Default(DataType.UUIDV4)
  @Column(DataType.UUID)
  public id;

  @Column(DataType.UUID)
  public webhookId: any;

  @Column(DataType.BOOLEAN)
  public success: any;

  @Column(DataType.INTEGER)
  public status: number;

  @Column(DataType.JSONB)
  public request: any;

  @Column(DataType.JSONB)
  public response: any;

  @Column
  public executedAt: Date;

  @BelongsTo(() => Webhook, {
    foreignKey: 'webhookId',
    onDelete: 'SET NULL',
    onUpdate: 'SET NULL',
  })
github BMalaichik / nestjs-starter-kit / packages / backend / src / modules / db / entities / user.entity.ts View on Github external
isActive?: boolean;

    @Column({
        type: DataType.STRING,
        allowNull: false,
    })
    passwordHash: string;

    @Column({
        type: DataType.STRING,
        allowNull: false,
    })
    username: string;

    @Column({
        type: DataType.INTEGER,
        allowNull: false,
    })
    @ForeignKey(() => Contact)
    contactId: number;

    @BelongsTo(() => Contact)
    contact: Contact;

    @CreatedAt
    createdAt?: Date;

    @UpdatedAt
    updatedAt?: Date;
}
github oughtinc / mosaic / server / lib / models / tree.ts View on Github external
@Column(DataType.BOOLEAN)
  public doesAllowOracleBypass: boolean;

  @Default(false)
  @Column(DataType.BOOLEAN)
  public isMIBWithoutRestarts: boolean;

  @AllowNull(false)
  @Default(1)
  @Column(DataType.INTEGER)
  public schedulingPriority: number;

  @AllowNull(false)
  @Default(6)
  @Column(DataType.INTEGER)
  public depthLimit: number;

  @BelongsTo(() => Workspace)
  public rootWorkspace: Workspace;

  @BelongsToMany(
    () => Experiment,
    "ExperimentTreeRelation",
    "TreeId",
    "ExperimentId",
  )
  public experiments: Experiment[];

  @HasMany(() => UserTreeOracleRelation)
  public oracleRelations: UserTreeOracleRelation[];
github adrien2p / nestjs-graphql / src / modules / users / user.entity.ts View on Github external
DataType,
    CreatedAt,
    UpdatedAt,
    DeletedAt,
    BeforeValidate,
    BeforeCreate,
} from 'sequelize-typescript';
import { IDefineOptions } from 'sequelize-typescript/lib/interfaces/IDefineOptions';
import { MessageCodeError } from '../common/lib/error/MessageCodeError';

const tableOptions: IDefineOptions = { timestamp: true, tableName: 'users' } as IDefineOptions;

@Table(tableOptions)
export class User extends Model {
    @Column({
        type: DataType.INTEGER,
        allowNull: false,
        autoIncrement: true,
        unique: true,
        primaryKey: true,
    })
    public id: number;

    @Column({
        type: DataType.CHAR(30),
        allowNull: false,
    })
    public firstName: string;

    @Column({
        type: DataType.CHAR(30),
        allowNull: false,
github turt2live / matrix-dimension / src / db / migrations / 20171218203245-AddTables.ts View on Github external
.then(() => queryInterface.createTable("dimension_upstreams", {
                "id": {type: DataType.INTEGER, primaryKey: true, autoIncrement: true, allowNull: false},
                "name": {type: DataType.STRING, allowNull: false},
                "type": {type: DataType.STRING, allowNull: false},
                "scalarUrl": {type: DataType.STRING, allowNull: false},
                "apiUrl": {type: DataType.STRING, allowNull: false},
            }))
            .then(() => queryInterface.createTable("dimension_scalar_tokens", {