it used to be possible to define tableName parameter in the Table decorator from sequelize-typescript like the below:
@Table({
tableName: 'my-custom-tablename'
})
export class Tenants extends Model<Tenants> {
@IsUUID(4)
@Default(uuid())
@PrimaryKey
@Column
uuid!: string;
@CreatedAt
@Column
created_at!: Date;
@UpdatedAt
@Column
updated_at!: Date;
}
With the latest version it doesn't seem possible to do this, only two options remain available:
modelName and version, so now, TableName is automatically mapped to the ModelName (className)
How to pass the real table name associated to the model?