Open RezaRahmati opened 3 years ago
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
SELECT create_hypertable('conditions', 'time');
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)
"sequelize": "^6.6.5", "sequelize-typescript": "^2.1.0" "typescript": "^4.3.5"
insert short code snippets here
I was able to work around this by doing this:
@Column({ type: DataType.DATE, allowNull: false, primaryKey: true }) uptime!: string;
It seemed to work if I set the time field as the primary key.
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 errorBased 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)
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
Actual behavior
Expected behavior
Steps to reproduce
Related code