Skip to content

I neet remove attribute id in model #1694

Open
@AnechaS

Description

@AnechaS

Nodejs v18.17.1
sequelize v 6.33.0
sequelize-typescript v2.1.5

@Table({
  tableName: 'USERS',
  timestamps: false,
})
export class User extends Model {
  @Column({ field: 'NAME' })
  name: string;

  @Column({ field: 'EMAIL' })
  email: string;
}

User.removeAttribute('id');

Error

throw new model_not_initialized_error_1.ModelNotInitializedError(this, `Member "${key}" cannot be called.`);
                      ^
ModelNotInitializedError: Model not initialized: Member "removeAttribute" cannot be called. "User" needs to be added to a Sequelize instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions