mirror of
https://github.com/daniviga/bite.git
synced 2025-04-25 00:01:19 +02:00
* Fix a regression in the hyperscale creation * Clean the jupyter notebook [skip ci] * Fix typos [skip ci] * Improve date args in API
25 lines
959 B
Python
25 lines
959 B
Python
# Generated by Django 3.1.7 on 2021-03-25 10:55
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('telemetry', '0001_initial'),
|
|
]
|
|
|
|
# Timescale requires an hyperscale table to have the field used for the
|
|
# partitioning ('time') to be in the any UNIQUE constraint.
|
|
# Because of that we have a unique_together on 'time' and 'device',
|
|
# however Django always adds an 'id' as PRIMARY_KEY.
|
|
# Django's 'id' isn't used as a foreign key, so we are dropping
|
|
# the contraint and simply adding an index to the 'id' column.
|
|
# We can now create the hypertable.
|
|
operations = [
|
|
migrations.RunSQL(
|
|
"ALTER TABLE telemetry_telemetry DROP CONSTRAINT telemetry_telemetry_pkey ;" # noqa: E501
|
|
"CREATE INDEX telemetry_telemetry_id_idx ON telemetry_telemetry(id);" # noqa: E501
|
|
"SELECT create_hypertable('telemetry_telemetry', 'time');"),
|
|
]
|