Skip to content

How to create table without primaryKey #1092

@RezaRahmati

Description

@RezaRahmati

Issue

I am trying to create a hyper-table in timescaleDb, instructions

When I try to run SELECT create_hypertable('conditions', 'time'); it gives me the below error

ERROR:  cannot create a unique index without the column "time" (used in partitioning)
SQL state: TS103

Based on this post seems table should not have a primary key to be able to become as hyper-table.

I wasn't able to config sequelize to prevent creating id (or PrimaryKey)

@Table({timestamps: false, tableName: "conditions"})
export class Conditions extends Model {
//   @Column({ type: DataType.UUIDV4, allowNull: true, primaryKey: false})
//   id: string;

  @Column({ type: DataType.DATE, allowNull: false})
  time: string;

  @Column({ type: DataType.TEXT, allowNull: false})
  location: number;

  @Column({ type: DataType.DATE, allowNull: false})
  temperature: number;

  @Column({ type: DataType.DATE, allowNull: true})
  humidity: number;
}

Not sure if it;s a defect or feature request (or something exists and I wasn't able to find it)

Versions

"sequelize": "^6.6.5",
"sequelize-typescript": "^2.1.0"
"typescript": "^4.3.5"

Issue type

  • bug report
  • feature request

Actual behavior

Expected behavior

Steps to reproduce

Related code

insert short code snippets here

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