quite new to timescaledb and I'm struggling with a migration script. I'm trying to create migrations for a flask application with SQLAlchemy.
Let's say I created a table (as in timescaledb docs) like the following:
CREATE TABLE conditions (
time TIMESTAMPTZ NOT NULL,
location TEXT NOT NULL,
temperature DOUBLE PRECISION NULL,
humidity DOUBLE PRECISION NULL
);
To add the hypertable, my upgrade migration script should do:
SELECT create_hypertable('conditions', 'time');
What should the downgrade part look like ? From timescaledb docs, they suggest:
DROP table conditions;
But I don't want the whole table to be dropped, only the "hypertable" part if that makes sense. Maybe this is silly and pointless, I want to provide a way out of timescaledb via our migrations. I've already read this SO question: Creating Hypertables through SQL Alchemy where no specific support seems provided for SQLAlchemy and they suggest triggers to create hypertables instead of a specific migration.
What would you suggest ?