diff --git a/schema/changelog-6.8.0.xml b/schema/changelog-6.8.0.xml new file mode 100644 index 000000000..f34b800ed --- /dev/null +++ b/schema/changelog-6.8.0.xml @@ -0,0 +1,36 @@ + + + + + + + + SELECT 1 FROM pg_available_extensions WHERE name = 'timescaledb'; + + + + + CREATE EXTENSION IF NOT EXISTS timescaledb; + + ALTER TABLE tc_positions DROP CONSTRAINT IF EXISTS tc_positions_pkey; + DROP INDEX IF EXISTS position_deviceid_fixtime; + + SELECT create_hypertable( + 'tc_positions', + 'fixtime', + partitioning_column => 'deviceid', + number_partitions => 8, + migrate_data => TRUE + ); + + CREATE INDEX IF NOT EXISTS tc_positions_id_idx ON tc_positions(id); + + + + + diff --git a/schema/changelog-master.xml b/schema/changelog-master.xml index 47652114d..2ba16d1c8 100644 --- a/schema/changelog-master.xml +++ b/schema/changelog-master.xml @@ -32,5 +32,6 @@ +