Created
October 2, 2020 01:10
-
-
Save moritz89/37bf5d4fb3820b8be6d7756237aa806d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import migrations | |
class Migration(migrations.Migration): | |
dependencies = [ | |
("farms", "0001_initial"), | |
] | |
operations = [ | |
migrations.RunSQL("SELECT create_hypertable('farms_sensorreading', 'time');"), | |
migrations.RunSQL( | |
"ALTER TABLE farms_sensorreading SET (timescaledb.compress, timescaledb.compress_segmentby = 'sensor_id');" | |
), | |
migrations.RunSQL( | |
"SELECT add_compress_chunks_policy('farms_sensorreading', INTERVAL '7 days');" | |
), | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment