Eu estou fazendo um add-migration com mappings para as entidades, porém está dando um erro e não sei onde ver o motivo do erro. using System; #nullable disable namespace TCM.RH.Data.Migrations { /// public partial class CriacaoBDTCMSistemaRHVotacao : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "TLotacaoVotacao", columns: table => new { idLotacaoVotacao = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), codLotacao = table.Column(type: "nvarchar(64)", nullable: false), idLotaocaoVotacaoVotacao = table.Column(type: "int", nullable: false), lotacao = table.Column(type: "nvarchar(80)", maxLength: 80, nullable: false) }, constraints: table => { table.PrimaryKey("PK_LotacaoVotacao", x => x.idLotacaoVotacao); });
migrationBuilder.CreateTable(
name: "TOpcaoVoto",
columns: table => new
{
idOpcaoVoto = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
nmOpcaoVoto = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: false),
dsOpcaoVoto = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
idOpcaoVotoVotacao = table.Column<int>(type: "int", nullable: false),
ordem = table.Column<int>(type: "int", nullable: false),
imagem = table.Column<string>(type: "nvarchar", nullable: false),
linksite = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OpcaoVoto", x => x.idOpcaoVoto);
});
migrationBuilder.CreateTable(
name: "TVotacao",
columns: table => new
{
idVotacao = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
titulo = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
dsVotacao = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: false),
(...//suprimi uns campos para poder enviar a msg))
mensagemEmail = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Votacao", x => x.idVotacao);
});
migrationBuilder.CreateTable(
name: "TVoto",
columns: table => new
{
idVoto = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
cpf = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: false),
idVotoVotacao = table.Column<int>(type: "int", nullable: false),
idVotoOpcaoVoto = table.Column<int>(type: "int", nullable: false),
dtVoto = table.Column<DateTime>(type: "datetime2", nullable: false),
chapa = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: false),
ipMaquina = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Voto", x => x.idVoto);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "TLotacaoVotacao");
migrationBuilder.DropTable(
name: "TOpcaoVoto");
migrationBuilder.DropTable(
name: "TVotacao");
migrationBuilder.DropTable(
name: "TVoto");
}
}
}