82 lines
4.2 KiB
C#
82 lines
4.2 KiB
C#
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<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
DN = table.Column<int>(type: "integer", nullable: false),
|
|
Number = table.Column<string>(type: "text", nullable: true),
|
|
Linerlength = table.Column<decimal>(type: "numeric", nullable: false),
|
|
IsAvaible = table.Column<bool>(type: "boolean", nullable: false),
|
|
Date = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
LinerNumber = table.Column<string>(type: "text", nullable: true),
|
|
WallThickness = table.Column<decimal>(type: "numeric", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Impregnations", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "PipeLiners",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
InversionPressure = table.Column<decimal>(type: "numeric", nullable: false),
|
|
ImpregnationId = table.Column<int>(type: "integer", nullable: true),
|
|
ClosedEnd = table.Column<bool>(type: "boolean", nullable: false),
|
|
Preliner = table.Column<bool>(type: "boolean", nullable: false),
|
|
TemperaturAssembly = table.Column<decimal>(type: "numeric", nullable: false),
|
|
TemperaturStorage = table.Column<decimal>(type: "numeric", nullable: false),
|
|
LinerLength = table.Column<decimal>(type: "numeric", nullable: false),
|
|
Operator = table.Column<string>(type: "text", nullable: true),
|
|
Date = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
TemperatureOutdoors = table.Column<decimal>(type: "numeric", nullable: false),
|
|
TemperatureSewer = table.Column<decimal>(type: "numeric", nullable: false),
|
|
Weather = table.Column<string>(type: "text", nullable: true),
|
|
CleanedHD = table.Column<bool>(type: "boolean", nullable: false),
|
|
CleanedMechanisch = table.Column<bool>(type: "boolean", nullable: false),
|
|
CleanedRoborter = table.Column<bool>(type: "boolean", nullable: false),
|
|
WaterBaried = table.Column<bool>(type: "boolean", nullable: false),
|
|
PermitNeeded = table.Column<bool>(type: "boolean", nullable: false),
|
|
STVO = table.Column<bool>(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");
|
|
}
|
|
}
|
|
}
|