Skip to content

Bigint support #1976

Closed
Closed
@Ajinkya1496

Description

@Ajinkya1496

I am using postgres 10 version, typeorm version 6.1.3 and pg version 7.11.0

I am facing issue with the bigint datatype. My entity looks like this.

@Entity({
  name:'users'
})
export class Users {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  name: string;

  @Column()
  team_id: number;
}

Now when I convert team_id datatype to bigint it gives me error saying
Data type "BigInt" in "Users.team_id" is not supported by "postgres" database
Postgres supports bigint and now javascript also supports bigint datatype.

How do I use bigint here in the entity. Current behaviour is that it converts bigint to string and wherever in the database I am using team_id, it goes as string only.

Is there possible solution or alterations that I can do to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions