This commit is contained in:
GuiNerd
2019-09-21 18:21:54 -03:00
parent d6ee0821c8
commit b46ddd2f0d
29 changed files with 1294 additions and 196 deletions

View File

@ -0,0 +1,181 @@
// <auto-generated />
using System;
using GerenciaProjetos.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GerenciaProjetos.Migrations
{
[DbContext(typeof(GerenciaContext))]
[Migration("20190921210546_1")]
partial class _1
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("GerenciaProjetos.Models.Bug", b =>
{
b.Property<int>("DesenvolvedorId");
b.Property<int>("RequisitoId");
b.HasKey("DesenvolvedorId", "RequisitoId");
b.HasIndex("RequisitoId");
b.ToTable("Bugs");
});
modelBuilder.Entity("GerenciaProjetos.Models.Desenvolvedor", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<bool>("EAdmin");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(100);
b.Property<string>("Nome")
.IsRequired()
.HasMaxLength(100);
b.Property<string>("Senha")
.IsRequired()
.HasMaxLength(45);
b.HasKey("Id");
b.ToTable("Desenvolvedores");
});
modelBuilder.Entity("GerenciaProjetos.Models.DesenvolvedorProjeto", b =>
{
b.Property<int>("DesenvolvedorId");
b.Property<int>("ProjetoId");
b.HasKey("DesenvolvedorId", "ProjetoId");
b.HasIndex("ProjetoId");
b.ToTable("DesenvolvedorProjeto");
});
modelBuilder.Entity("GerenciaProjetos.Models.DesenvolvedorRequisito", b =>
{
b.Property<int>("DesenvolvedorId");
b.Property<int>("RequisitoId");
b.HasKey("DesenvolvedorId", "RequisitoId");
b.HasIndex("RequisitoId");
b.ToTable("DesenvolvedorRequisito");
});
modelBuilder.Entity("GerenciaProjetos.Models.Projeto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("DataEntrega");
b.Property<string>("Nome")
.IsRequired()
.HasMaxLength(100);
b.Property<string>("Solicitante")
.IsRequired()
.HasMaxLength(45);
b.HasKey("Id");
b.ToTable("Projetos");
});
modelBuilder.Entity("GerenciaProjetos.Models.Requisito", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("DataCadastro");
b.Property<DateTime>("DataEntrega");
b.Property<string>("Descricao")
.IsRequired()
.HasMaxLength(100);
b.Property<bool>("EFuncional");
b.Property<string>("Observacoes")
.HasMaxLength(100);
b.Property<int>("ProjetoId");
b.HasKey("Id");
b.HasIndex("ProjetoId");
b.ToTable("Requisitos");
});
modelBuilder.Entity("GerenciaProjetos.Models.Bug", b =>
{
b.HasOne("GerenciaProjetos.Models.Desenvolvedor", "Desenvolvedor")
.WithMany()
.HasForeignKey("DesenvolvedorId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("GerenciaProjetos.Models.Requisito", "Requisito")
.WithMany()
.HasForeignKey("RequisitoId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("GerenciaProjetos.Models.DesenvolvedorProjeto", b =>
{
b.HasOne("GerenciaProjetos.Models.Desenvolvedor", "Desenvolvedor")
.WithMany()
.HasForeignKey("DesenvolvedorId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("GerenciaProjetos.Models.Projeto", "Projeto")
.WithMany()
.HasForeignKey("ProjetoId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("GerenciaProjetos.Models.DesenvolvedorRequisito", b =>
{
b.HasOne("GerenciaProjetos.Models.Desenvolvedor", "Desenvolvedor")
.WithMany()
.HasForeignKey("DesenvolvedorId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("GerenciaProjetos.Models.Requisito", "Requisito")
.WithMany()
.HasForeignKey("RequisitoId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("GerenciaProjetos.Models.Requisito", b =>
{
b.HasOne("GerenciaProjetos.Models.Projeto", "Projeto")
.WithMany("Requisitos")
.HasForeignKey("ProjetoId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

View File

@ -44,18 +44,17 @@ namespace GerenciaProjetos.Migrations
columns: table => new
{
DesenvolvedorId = table.Column<int>(nullable: false),
ProjetoId = table.Column<int>(nullable: false),
DesenvolvedorId1 = table.Column<int>(nullable: true)
ProjetoId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DesenvolvedorProjeto", x => new { x.DesenvolvedorId, x.ProjetoId });
table.ForeignKey(
name: "FK_DesenvolvedorProjeto_Desenvolvedores_DesenvolvedorId1",
column: x => x.DesenvolvedorId1,
name: "FK_DesenvolvedorProjeto_Desenvolvedores_DesenvolvedorId",
column: x => x.DesenvolvedorId,
principalTable: "Desenvolvedores",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DesenvolvedorProjeto_Projetos_ProjetoId",
column: x => x.ProjetoId,
@ -93,28 +92,17 @@ namespace GerenciaProjetos.Migrations
columns: table => new
{
DesenvolvedorId = table.Column<int>(nullable: false),
RequisitoId = table.Column<int>(nullable: false),
DesenvolvedorId1 = table.Column<int>(nullable: true),
Prioridade = table.Column<string>(nullable: true),
DataCadastro = table.Column<DateTime>(nullable: false),
CriadorId = table.Column<int>(nullable: false),
FoiResolvido = table.Column<bool>(nullable: false)
RequisitoId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Bugs", x => new { x.DesenvolvedorId, x.RequisitoId });
table.ForeignKey(
name: "FK_Bugs_Desenvolvedores_CriadorId",
column: x => x.CriadorId,
name: "FK_Bugs_Desenvolvedores_DesenvolvedorId",
column: x => x.DesenvolvedorId,
principalTable: "Desenvolvedores",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Bugs_Desenvolvedores_DesenvolvedorId1",
column: x => x.DesenvolvedorId1,
principalTable: "Desenvolvedores",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Bugs_Requisitos_RequisitoId",
column: x => x.RequisitoId,
@ -128,19 +116,17 @@ namespace GerenciaProjetos.Migrations
columns: table => new
{
DesenvolvedorId = table.Column<int>(nullable: false),
RequisitoId = table.Column<int>(nullable: false),
DesenvolvedorId1 = table.Column<int>(nullable: true),
TempoGasto = table.Column<TimeSpan>(nullable: false)
RequisitoId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DesenvolvedorRequisito", x => new { x.DesenvolvedorId, x.RequisitoId });
table.ForeignKey(
name: "FK_DesenvolvedorRequisito_Desenvolvedores_DesenvolvedorId1",
column: x => x.DesenvolvedorId1,
name: "FK_DesenvolvedorRequisito_Desenvolvedores_DesenvolvedorId",
column: x => x.DesenvolvedorId,
principalTable: "Desenvolvedores",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DesenvolvedorRequisito_Requisitos_RequisitoId",
column: x => x.RequisitoId,
@ -149,36 +135,16 @@ namespace GerenciaProjetos.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Bugs_CriadorId",
table: "Bugs",
column: "CriadorId");
migrationBuilder.CreateIndex(
name: "IX_Bugs_DesenvolvedorId1",
table: "Bugs",
column: "DesenvolvedorId1");
migrationBuilder.CreateIndex(
name: "IX_Bugs_RequisitoId",
table: "Bugs",
column: "RequisitoId");
migrationBuilder.CreateIndex(
name: "IX_DesenvolvedorProjeto_DesenvolvedorId1",
table: "DesenvolvedorProjeto",
column: "DesenvolvedorId1");
migrationBuilder.CreateIndex(
name: "IX_DesenvolvedorProjeto_ProjetoId",
table: "DesenvolvedorProjeto",
column: "ProjetoId");
migrationBuilder.CreateIndex(
name: "IX_DesenvolvedorRequisito_DesenvolvedorId1",
table: "DesenvolvedorRequisito",
column: "DesenvolvedorId1");
migrationBuilder.CreateIndex(
name: "IX_DesenvolvedorRequisito_RequisitoId",
table: "DesenvolvedorRequisito",

View File

@ -5,13 +5,12 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using AppContext = GerenciaProjetos.Data.AppContext;
namespace GerenciaProjetos.Migrations
{
[DbContext(typeof(AppContext))]
[Migration("20190921193724_1")]
partial class _1
[DbContext(typeof(GerenciaContext))]
[Migration("20190921210818_2")]
partial class _2
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
@ -30,8 +29,6 @@ namespace GerenciaProjetos.Migrations
b.Property<DateTime>("DataCadastro");
b.Property<int?>("DesenvolvedorId1");
b.Property<bool>("FoiResolvido");
b.Property<string>("Prioridade");
@ -40,8 +37,6 @@ namespace GerenciaProjetos.Migrations
b.HasIndex("CriadorId");
b.HasIndex("DesenvolvedorId1");
b.HasIndex("RequisitoId");
b.ToTable("Bugs");
@ -77,12 +72,8 @@ namespace GerenciaProjetos.Migrations
b.Property<int>("ProjetoId");
b.Property<int?>("DesenvolvedorId1");
b.HasKey("DesenvolvedorId", "ProjetoId");
b.HasIndex("DesenvolvedorId1");
b.HasIndex("ProjetoId");
b.ToTable("DesenvolvedorProjeto");
@ -94,14 +85,10 @@ namespace GerenciaProjetos.Migrations
b.Property<int>("RequisitoId");
b.Property<int?>("DesenvolvedorId1");
b.Property<TimeSpan>("TempoGasto");
b.HasKey("DesenvolvedorId", "RequisitoId");
b.HasIndex("DesenvolvedorId1");
b.HasIndex("RequisitoId");
b.ToTable("DesenvolvedorRequisito");
@ -163,7 +150,8 @@ namespace GerenciaProjetos.Migrations
b.HasOne("GerenciaProjetos.Models.Desenvolvedor", "Desenvolvedor")
.WithMany()
.HasForeignKey("DesenvolvedorId1");
.HasForeignKey("DesenvolvedorId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("GerenciaProjetos.Models.Requisito", "Requisito")
.WithMany()
@ -175,7 +163,8 @@ namespace GerenciaProjetos.Migrations
{
b.HasOne("GerenciaProjetos.Models.Desenvolvedor", "Desenvolvedor")
.WithMany()
.HasForeignKey("DesenvolvedorId1");
.HasForeignKey("DesenvolvedorId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("GerenciaProjetos.Models.Projeto", "Projeto")
.WithMany()
@ -187,7 +176,8 @@ namespace GerenciaProjetos.Migrations
{
b.HasOne("GerenciaProjetos.Models.Desenvolvedor", "Desenvolvedor")
.WithMany()
.HasForeignKey("DesenvolvedorId1");
.HasForeignKey("DesenvolvedorId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("GerenciaProjetos.Models.Requisito", "Requisito")
.WithMany()

View File

@ -0,0 +1,84 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace GerenciaProjetos.Migrations
{
public partial class _2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<TimeSpan>(
name: "TempoGasto",
table: "DesenvolvedorRequisito",
nullable: false,
defaultValue: new TimeSpan(0, 0, 0, 0, 0));
migrationBuilder.AddColumn<int>(
name: "CriadorId",
table: "Bugs",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<DateTime>(
name: "DataCadastro",
table: "Bugs",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<bool>(
name: "FoiResolvido",
table: "Bugs",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "Prioridade",
table: "Bugs",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Bugs_CriadorId",
table: "Bugs",
column: "CriadorId");
migrationBuilder.AddForeignKey(
name: "FK_Bugs_Desenvolvedores_CriadorId",
table: "Bugs",
column: "CriadorId",
principalTable: "Desenvolvedores",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Bugs_Desenvolvedores_CriadorId",
table: "Bugs");
migrationBuilder.DropIndex(
name: "IX_Bugs_CriadorId",
table: "Bugs");
migrationBuilder.DropColumn(
name: "TempoGasto",
table: "DesenvolvedorRequisito");
migrationBuilder.DropColumn(
name: "CriadorId",
table: "Bugs");
migrationBuilder.DropColumn(
name: "DataCadastro",
table: "Bugs");
migrationBuilder.DropColumn(
name: "FoiResolvido",
table: "Bugs");
migrationBuilder.DropColumn(
name: "Prioridade",
table: "Bugs");
}
}
}

View File

@ -4,12 +4,11 @@ using GerenciaProjetos.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using AppContext = GerenciaProjetos.Data.AppContext;
namespace GerenciaProjetos.Migrations
{
[DbContext(typeof(AppContext))]
partial class AppContextModelSnapshot : ModelSnapshot
[DbContext(typeof(GerenciaContext))]
partial class GerenciaContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
@ -28,8 +27,6 @@ namespace GerenciaProjetos.Migrations
b.Property<DateTime>("DataCadastro");
b.Property<int?>("DesenvolvedorId1");
b.Property<bool>("FoiResolvido");
b.Property<string>("Prioridade");
@ -38,8 +35,6 @@ namespace GerenciaProjetos.Migrations
b.HasIndex("CriadorId");
b.HasIndex("DesenvolvedorId1");
b.HasIndex("RequisitoId");
b.ToTable("Bugs");
@ -75,12 +70,8 @@ namespace GerenciaProjetos.Migrations
b.Property<int>("ProjetoId");
b.Property<int?>("DesenvolvedorId1");
b.HasKey("DesenvolvedorId", "ProjetoId");
b.HasIndex("DesenvolvedorId1");
b.HasIndex("ProjetoId");
b.ToTable("DesenvolvedorProjeto");
@ -92,14 +83,10 @@ namespace GerenciaProjetos.Migrations
b.Property<int>("RequisitoId");
b.Property<int?>("DesenvolvedorId1");
b.Property<TimeSpan>("TempoGasto");
b.HasKey("DesenvolvedorId", "RequisitoId");
b.HasIndex("DesenvolvedorId1");
b.HasIndex("RequisitoId");
b.ToTable("DesenvolvedorRequisito");
@ -161,7 +148,8 @@ namespace GerenciaProjetos.Migrations
b.HasOne("GerenciaProjetos.Models.Desenvolvedor", "Desenvolvedor")
.WithMany()
.HasForeignKey("DesenvolvedorId1");
.HasForeignKey("DesenvolvedorId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("GerenciaProjetos.Models.Requisito", "Requisito")
.WithMany()
@ -173,7 +161,8 @@ namespace GerenciaProjetos.Migrations
{
b.HasOne("GerenciaProjetos.Models.Desenvolvedor", "Desenvolvedor")
.WithMany()
.HasForeignKey("DesenvolvedorId1");
.HasForeignKey("DesenvolvedorId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("GerenciaProjetos.Models.Projeto", "Projeto")
.WithMany()
@ -185,7 +174,8 @@ namespace GerenciaProjetos.Migrations
{
b.HasOne("GerenciaProjetos.Models.Desenvolvedor", "Desenvolvedor")
.WithMany()
.HasForeignKey("DesenvolvedorId1");
.HasForeignKey("DesenvolvedorId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("GerenciaProjetos.Models.Requisito", "Requisito")
.WithMany()