The question pretty much says it all. I'm trying to create a hypertable with TimescaleDB from a table with joint Primary Key:
CREATE TABLE cars
(
id BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY,
time_bought TIMESTAMP NOT NULL,
brand VARCHAR(100),
);
ALTER TABLE cars ADD CONSTRAINT PK_id_time_bought PRIMARY KEY(id, time_bought);
SELECT create_hypertable('cars', 'time_bought');
When i try to run this with Java via Intellij i get this error:
SQL State : 42883
Error Code : 0
Message : ERROR: function create_hypertable(unknown, unknown) does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 8
Location : db/migration/tenants/V1__init_schema.sql (C:\example\target\classes\db\migration\tenants\V1__init_schema.sql)
Line : 45
Statement : SELECT create_hypertable('cars', 'time_bought')
Update: I've tried to run the migration without putting any Primary Keys in the table, and it still gives the same error. Could the problem be that Flyway does not support TimescaleDB functions at all? And if so, how do I work around it?