using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace DaSaSo.EntityFramework.Migrations { public partial class Lineradded : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Impregnations", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), DN = table.Column(type: "integer", nullable: false), Number = table.Column(type: "text", nullable: true), Linerlength = table.Column(type: "numeric", nullable: false), IsAvaible = table.Column(type: "boolean", nullable: false), Date = table.Column(type: "timestamp without time zone", nullable: false), LinerNumber = table.Column(type: "text", nullable: true), WallThickness = table.Column(type: "numeric", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Impregnations", x => x.Id); }); migrationBuilder.CreateTable( name: "PipeLiners", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), InversionPressure = table.Column(type: "numeric", nullable: false), ImpregnationId = table.Column(type: "integer", nullable: true), ClosedEnd = table.Column(type: "boolean", nullable: false), Preliner = table.Column(type: "boolean", nullable: false), TemperaturAssembly = table.Column(type: "numeric", nullable: false), TemperaturStorage = table.Column(type: "numeric", nullable: false), LinerLength = table.Column(type: "numeric", nullable: false), Operator = table.Column(type: "text", nullable: true), Date = table.Column(type: "timestamp without time zone", nullable: false), TemperatureOutdoors = table.Column(type: "numeric", nullable: false), TemperatureSewer = table.Column(type: "numeric", nullable: false), Weather = table.Column(type: "text", nullable: true), CleanedHD = table.Column(type: "boolean", nullable: false), CleanedMechanisch = table.Column(type: "boolean", nullable: false), CleanedRoborter = table.Column(type: "boolean", nullable: false), WaterBaried = table.Column(type: "boolean", nullable: false), PermitNeeded = table.Column(type: "boolean", nullable: false), STVO = table.Column(type: "boolean", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PipeLiners", x => x.Id); table.ForeignKey( name: "FK_PipeLiners_Impregnations_ImpregnationId", column: x => x.ImpregnationId, principalTable: "Impregnations", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_PipeLiners_ImpregnationId", table: "PipeLiners", column: "ImpregnationId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PipeLiners"); migrationBuilder.DropTable( name: "Impregnations"); } } }