add migration hypertable and chunks

This commit is contained in:
eugeniy_ivanov 2023-03-28 03:00:20 +05:00
parent a53bf11900
commit b922ac245a
2 changed files with 7966 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class WITS_GTR_manual_hypertable : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql
("SELECT create_hypertable('t_wits_base','time','id_telemetry',chunk_time_interval => INTERVAL '5 day'); " +
"SELECT create_hypertable('t_wits_string','time','id_telemetry',chunk_time_interval => INTERVAL '5 day'); " +
"SELECT create_hypertable('t_wits_float','time','id_telemetry',chunk_time_interval => INTERVAL '5 day'); " +
"SELECT create_hypertable('t_wits_int','time','id_telemetry',chunk_time_interval => INTERVAL '5 day'); ");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}