using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SteUp.Data.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Ispezioni", columns: table => new { CodMdep = table.Column(type: "TEXT", nullable: false), Data = table.Column(type: "TEXT", nullable: false), Rilevatore = table.Column(type: "TEXT", nullable: false), Stato = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Ispezioni", x => new { x.CodMdep, x.Data, x.Rilevatore }); }); migrationBuilder.CreateTable( name: "Schede", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), CodJfas = table.Column(type: "TEXT", nullable: true), CodMdep = table.Column(type: "TEXT", nullable: false), Data = table.Column(type: "TEXT", nullable: false), Rilevatore = table.Column(type: "TEXT", nullable: false), DescrizioneReparto = table.Column(type: "TEXT", nullable: true), ActivityTypeId = table.Column(type: "TEXT", nullable: true), Note = table.Column(type: "TEXT", nullable: true), Responsabile = table.Column(type: "TEXT", nullable: true), Scadenza = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Schede", x => x.Id); table.ForeignKey( name: "FK_Schede_Ispezioni_CodMdep_Data_Rilevatore", columns: x => new { x.CodMdep, x.Data, x.Rilevatore }, principalTable: "Ispezioni", principalColumns: new[] { "CodMdep", "Data", "Rilevatore" }, onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Schede_CodMdep_Data_Rilevatore", table: "Schede", columns: new[] { "CodMdep", "Data", "Rilevatore" }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Schede"); migrationBuilder.DropTable( name: "Ispezioni"); } } }