14 lines
859 B
SQL
14 lines
859 B
SQL
-- Enable TimescaleDB so the app's climate record lives in hypertables
|
|
-- (climate_history) instead of parquet files. The stock timescale/timescaledb
|
|
-- image already preloads the extension (shared_preload_libraries=timescaledb);
|
|
-- this just runs CREATE EXTENSION on first cluster init.
|
|
--
|
|
-- This runs once, on first cluster init (empty PGDATA), from
|
|
-- /docker-entrypoint-initdb.d. Because the compose `db` service keeps its data on
|
|
-- a persistent named volume, init scripts do NOT re-run on an existing database.
|
|
-- Alembic (backend/alembic) also runs `CREATE EXTENSION IF NOT EXISTS timescaledb`
|
|
-- at app boot, so an existing volume gets it there; to enable it by hand instead:
|
|
--
|
|
-- docker compose exec db psql -U thermograph -d thermograph \
|
|
-- -c 'CREATE EXTENSION IF NOT EXISTS timescaledb;'
|
|
CREATE EXTENSION IF NOT EXISTS timescaledb;
|