using Microsoft.EntityFrameworkCore.Migrations; using System; #nullable disable namespace AsbCloudDb.Migrations { public partial class Add_WitsRecords : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "RecordBase", columns: table => new { id_telemetry = table.Column(type: "integer", nullable: false), date = table.Column(type: "timestamp with time zone", nullable: false), WELLID = table.Column(type: "text", nullable: true), STKNUM = table.Column(type: "smallint", nullable: true), RECID = table.Column(type: "smallint", nullable: true), SEQID = table.Column(type: "integer", nullable: true), DATE = table.Column(type: "integer", nullable: true), TIME = table.Column(type: "integer", nullable: true), ACTCOD = table.Column(type: "smallint", nullable: true) }, constraints: table => { table.PrimaryKey("PK_RecordBase", x => new { x.id_telemetry, x.date }); }); migrationBuilder.CreateTable( name: "t_record_1", columns: table => new { id_telemetry = table.Column(type: "integer", nullable: false), date = table.Column(type: "timestamp with time zone", nullable: false), DEPTBITM = table.Column(type: "real", nullable: true), DEPTBITV = table.Column(type: "real", nullable: true), DEPTMEAS = table.Column(type: "real", nullable: true), DEPTVERT = table.Column(type: "real", nullable: true), BLKPOS = table.Column(type: "real", nullable: true), ROPA = table.Column(type: "real", nullable: true), HKLA = table.Column(type: "real", nullable: true), HKLX = table.Column(type: "real", nullable: true), WOBA = table.Column(type: "real", nullable: true), WOBX = table.Column(type: "real", nullable: true), TORQA = table.Column(type: "real", nullable: true), TORQX = table.Column(type: "real", nullable: true), RPMA = table.Column(type: "smallint", nullable: true), SPPA = table.Column(type: "real", nullable: true), CHKP = table.Column(type: "real", nullable: true), SPM1 = table.Column(type: "smallint", nullable: true), SPM2 = table.Column(type: "smallint", nullable: true), SPM3 = table.Column(type: "smallint", nullable: true), TVOLACT = table.Column(type: "real", nullable: true), TVOLCACT = table.Column(type: "real", nullable: true), MFOP = table.Column(type: "smallint", nullable: true), MFOA = table.Column(type: "real", nullable: true), MFIA = table.Column(type: "real", nullable: true), MDOA = table.Column(type: "real", nullable: true), MDIA = table.Column(type: "real", nullable: true), MTOA = table.Column(type: "real", nullable: true), MTIA = table.Column(type: "real", nullable: true), MCOA = table.Column(type: "real", nullable: true), MCIA = table.Column(type: "real", nullable: true), STKC = table.Column(type: "integer", nullable: true), LAGSTKS = table.Column(type: "smallint", nullable: true), DEPTRETM = table.Column(type: "real", nullable: true), GASA = table.Column(type: "real", nullable: true), SPARE1 = table.Column(type: "real", nullable: true), SPARE2 = table.Column(type: "real", nullable: true), SPARE3 = table.Column(type: "real", nullable: true), SPARE4 = table.Column(type: "real", nullable: true), SPARE5 = table.Column(type: "real", nullable: true), TelemetryId = table.Column(type: "integer", nullable: true) }, constraints: table => { table.PrimaryKey("PK_t_record_1", x => new { x.id_telemetry, x.date }); table.ForeignKey( name: "FK_t_record_1_RecordBase_id_telemetry_date", columns: x => new { x.id_telemetry, x.date }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_t_record_1_t_telemetry_TelemetryId", column: x => x.TelemetryId, principalTable: "t_telemetry", principalColumn: "id"); }); migrationBuilder.CreateTable( name: "t_record_50", columns: table => new { id_telemetry = table.Column(type: "integer", nullable: false), date = table.Column(type: "timestamp with time zone", nullable: false), DEPTBITM = table.Column(type: "real", nullable: true), DEPTMEAS_MCRSTAT = table.Column(type: "real", nullable: true), MCRSTAT = table.Column(type: "real", nullable: true), DEPTMEAS_SLVL_mc = table.Column(type: "real", nullable: true), SLVL_mc = table.Column(type: "real", nullable: true), DEPTMEAS_GDP_mc = table.Column(type: "real", nullable: true), GDP_mc = table.Column(type: "real", nullable: true), DEPTMEAS_RA33F2_mc = table.Column(type: "real", nullable: true), RA33F2_mc = table.Column(type: "real", nullable: true), DEPTMEAS_RP33F2_mc = table.Column(type: "real", nullable: true), RP33F2_mc = table.Column(type: "real", nullable: true), DEPTMEAS_RA33F4_mc = table.Column(type: "real", nullable: true), RA33F4_mc = table.Column(type: "real", nullable: true), DEPTMEAS_RP33F4_mc = table.Column(type: "real", nullable: true), RP33F4_mc = table.Column(type: "real", nullable: true), DEPTMEAS_RA33_mc = table.Column(type: "real", nullable: true), RA33_mc = table.Column(type: "real", nullable: true), DEPTMEAS_RP33_mc = table.Column(type: "real", nullable: true), RP33_mc = table.Column(type: "real", nullable: true), TelemetryId = table.Column(type: "integer", nullable: true) }, constraints: table => { table.PrimaryKey("PK_t_record_50", x => new { x.id_telemetry, x.date }); table.ForeignKey( name: "FK_t_record_50_RecordBase_id_telemetry_date", columns: x => new { x.id_telemetry, x.date }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_t_record_50_t_telemetry_TelemetryId", column: x => x.TelemetryId, principalTable: "t_telemetry", principalColumn: "id"); }); migrationBuilder.CreateTable( name: "t_record_60", columns: table => new { id_telemetry = table.Column(type: "integer", nullable: false), date = table.Column(type: "timestamp with time zone", nullable: false), DEPTBITM = table.Column(type: "real", nullable: true), DEPTMEAS = table.Column(type: "real", nullable: true), Gtot = table.Column(type: "real", nullable: true), Gx = table.Column(type: "real", nullable: true), Gy = table.Column(type: "real", nullable: true), Gz = table.Column(type: "real", nullable: true), Btot = table.Column(type: "real", nullable: true), Bx = table.Column(type: "real", nullable: true), By = table.Column(type: "real", nullable: true), Bz = table.Column(type: "real", nullable: true), TelemetryId = table.Column(type: "integer", nullable: true) }, constraints: table => { table.PrimaryKey("PK_t_record_60", x => new { x.id_telemetry, x.date }); table.ForeignKey( name: "FK_t_record_60_RecordBase_id_telemetry_date", columns: x => new { x.id_telemetry, x.date }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_t_record_60_t_telemetry_TelemetryId", column: x => x.TelemetryId, principalTable: "t_telemetry", principalColumn: "id"); }); migrationBuilder.CreateTable( name: "t_record_61", columns: table => new { id_telemetry = table.Column(type: "integer", nullable: false), date = table.Column(type: "timestamp with time zone", nullable: false), DEPTBITM = table.Column(type: "real", nullable: true), DEPTMEAS = table.Column(type: "real", nullable: true), PHL1F1 = table.Column(type: "real", nullable: true), PHL1F2 = table.Column(type: "real", nullable: true), PHL2F1 = table.Column(type: "real", nullable: true), PHL2F2 = table.Column(type: "real", nullable: true), ATT06H = table.Column(type: "real", nullable: true), ATT06L = table.Column(type: "real", nullable: true), ATT10H = table.Column(type: "real", nullable: true), ATT10L = table.Column(type: "real", nullable: true), Status = table.Column(type: "real", nullable: true), TelemetryId = table.Column(type: "integer", nullable: true) }, constraints: table => { table.PrimaryKey("PK_t_record_61", x => new { x.id_telemetry, x.date }); table.ForeignKey( name: "FK_t_record_61_RecordBase_id_telemetry_date", columns: x => new { x.id_telemetry, x.date }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_t_record_61_t_telemetry_TelemetryId", column: x => x.TelemetryId, principalTable: "t_telemetry", principalColumn: "id"); }); migrationBuilder.CreateTable( name: "t_record_7", columns: table => new { id_telemetry = table.Column(type: "integer", nullable: false), date = table.Column(type: "timestamp with time zone", nullable: false), DEPTSVYM = table.Column(type: "real", nullable: true), DEPTSVYV = table.Column(type: "real", nullable: true), PASSNUM = table.Column(type: "smallint", nullable: true), DEPTMEAS = table.Column(type: "real", nullable: true), SVYTYPE = table.Column(type: "text", nullable: true), SVYINC = table.Column(type: "real", nullable: true), SVYAZU = table.Column(type: "real", nullable: true), SVYAZC = table.Column(type: "real", nullable: true), SVYMTF = table.Column(type: "real", nullable: true), SVYGTF = table.Column(type: "real", nullable: true), SVYNS = table.Column(type: "real", nullable: true), SVYEW = table.Column(type: "real", nullable: true), SVYDLS = table.Column(type: "real", nullable: true), SVYWALK = table.Column(type: "real", nullable: true), SPARE1 = table.Column(type: "real", nullable: true), SPARE2 = table.Column(type: "real", nullable: true), SPARE3 = table.Column(type: "real", nullable: true), SPARE4 = table.Column(type: "real", nullable: true), SPARE5 = table.Column(type: "real", nullable: true), TelemetryId = table.Column(type: "integer", nullable: true) }, constraints: table => { table.PrimaryKey("PK_t_record_7", x => new { x.id_telemetry, x.date }); table.ForeignKey( name: "FK_t_record_7_RecordBase_id_telemetry_date", columns: x => new { x.id_telemetry, x.date }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_t_record_7_t_telemetry_TelemetryId", column: x => x.TelemetryId, principalTable: "t_telemetry", principalColumn: "id"); }); migrationBuilder.CreateTable( name: "t_record_8", columns: table => new { id_telemetry = table.Column(type: "integer", nullable: false), date = table.Column(type: "timestamp with time zone", nullable: false), DEPTMEAS = table.Column(type: "real", nullable: true), DEPTVERT = table.Column(type: "real", nullable: true), DEPTBITM = table.Column(type: "real", nullable: true), DEPTBITV = table.Column(type: "real", nullable: true), PASSNUM = table.Column(type: "smallint", nullable: true), DEPTRS1M = table.Column(type: "real", nullable: true), DEPTRS1V = table.Column(type: "real", nullable: true), MR1 = table.Column(type: "real", nullable: true), MR1C = table.Column(type: "real", nullable: true), DEPTRS2M = table.Column(type: "real", nullable: true), DEPTRS2V = table.Column(type: "real", nullable: true), MR2 = table.Column(type: "real", nullable: true), MR2C = table.Column(type: "real", nullable: true), DEPTGR1M = table.Column(type: "real", nullable: true), DEPTGR1V = table.Column(type: "real", nullable: true), MG1 = table.Column(type: "real", nullable: true), MG1C = table.Column(type: "real", nullable: true), DEPTGR2M = table.Column(type: "real", nullable: true), DEPTGR2V = table.Column(type: "real", nullable: true), MG2 = table.Column(type: "real", nullable: true), MG2C = table.Column(type: "real", nullable: true), DEPTP1M = table.Column(type: "real", nullable: true), DEPTP1V = table.Column(type: "real", nullable: true), MPO1 = table.Column(type: "real", nullable: true), DEPTP2M = table.Column(type: "real", nullable: true), DEPTP2V = table.Column(type: "real", nullable: true), MPO2 = table.Column(type: "real", nullable: true), MFTANN = table.Column(type: "real", nullable: true), MFTPIPE = table.Column(type: "real", nullable: true), MFRANN = table.Column(type: "real", nullable: true), MFRPIPE = table.Column(type: "real", nullable: true), DEPTFDM = table.Column(type: "real", nullable: true), DEPTFDV = table.Column(type: "real", nullable: true), MFD = table.Column(type: "real", nullable: true), DEPTCALM = table.Column(type: "real", nullable: true), DEPTCALV = table.Column(type: "real", nullable: true), MCLP = table.Column(type: "real", nullable: true), MFPP = table.Column(type: "real", nullable: true), MFFP = table.Column(type: "real", nullable: true), SPARE1 = table.Column(type: "real", nullable: true), SPARE2 = table.Column(type: "real", nullable: true), SPARE3 = table.Column(type: "real", nullable: true), SPARE4 = table.Column(type: "real", nullable: true), SPARE5 = table.Column(type: "real", nullable: true), SPARE6 = table.Column(type: "real", nullable: true), SPARE7 = table.Column(type: "real", nullable: true), SPARE8 = table.Column(type: "real", nullable: true), SPARE9 = table.Column(type: "real", nullable: true), TelemetryId = table.Column(type: "integer", nullable: true) }, constraints: table => { table.PrimaryKey("PK_t_record_8", x => new { x.id_telemetry, x.date }); table.ForeignKey( name: "FK_t_record_8_RecordBase_id_telemetry_date", columns: x => new { x.id_telemetry, x.date }, principalTable: "RecordBase", principalColumns: new[] { "id_telemetry", "date" }, onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_t_record_8_t_telemetry_TelemetryId", column: x => x.TelemetryId, principalTable: "t_telemetry", principalColumn: "id"); }); migrationBuilder.CreateIndex( name: "IX_t_record_1_TelemetryId", table: "t_record_1", column: "TelemetryId"); migrationBuilder.CreateIndex( name: "IX_t_record_50_TelemetryId", table: "t_record_50", column: "TelemetryId"); migrationBuilder.CreateIndex( name: "IX_t_record_60_TelemetryId", table: "t_record_60", column: "TelemetryId"); migrationBuilder.CreateIndex( name: "IX_t_record_61_TelemetryId", table: "t_record_61", column: "TelemetryId"); migrationBuilder.CreateIndex( name: "IX_t_record_7_TelemetryId", table: "t_record_7", column: "TelemetryId"); migrationBuilder.CreateIndex( name: "IX_t_record_8_TelemetryId", table: "t_record_8", column: "TelemetryId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "t_record_1"); migrationBuilder.DropTable( name: "t_record_50"); migrationBuilder.DropTable( name: "t_record_60"); migrationBuilder.DropTable( name: "t_record_61"); migrationBuilder.DropTable( name: "t_record_7"); migrationBuilder.DropTable( name: "t_record_8"); migrationBuilder.DropTable( name: "RecordBase"); } } }