diff --git a/test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/20170628102530_Init.Designer.cs b/test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/20170628102530_Init.Designer.cs new file mode 100644 index 0000000..48d601f --- /dev/null +++ b/test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/20170628102530_Init.Designer.cs @@ -0,0 +1,67 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using DotNetCore.CAP.EntityFrameworkCore.Test; + +namespace DotNetCore.CAP.EntityFrameworkCore.Test.Migrations +{ + [DbContext(typeof(TestDbContext))] + [Migration("20170628102530_Init")] + partial class Init + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.1.2") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("DotNetCore.CAP.Infrastructure.CapReceivedMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Added"); + + b.Property("Content"); + + b.Property("KeyName"); + + b.Property("LastRun"); + + b.Property("Retries"); + + b.Property("StateName") + .HasMaxLength(50); + + b.HasKey("Id"); + + b.ToTable("CapReceivedMessages"); + }); + + modelBuilder.Entity("DotNetCore.CAP.Infrastructure.CapSentMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Added"); + + b.Property("Content"); + + b.Property("KeyName"); + + b.Property("LastRun"); + + b.Property("Retries"); + + b.Property("StateName") + .HasMaxLength(50); + + b.HasKey("Id"); + + b.ToTable("CapSentMessages"); + }); + } + } +} diff --git a/test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/20170628102530_Init.cs b/test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/20170628102530_Init.cs new file mode 100644 index 0000000..4e6ad81 --- /dev/null +++ b/test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/20170628102530_Init.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace DotNetCore.CAP.EntityFrameworkCore.Test.Migrations +{ + public partial class Init : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "CapReceivedMessages", + columns: table => new + { + Id = table.Column(nullable: false), + Added = table.Column(nullable: false), + Content = table.Column(nullable: true), + KeyName = table.Column(nullable: true), + LastRun = table.Column(nullable: false), + Retries = table.Column(nullable: false), + StateName = table.Column(maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_CapReceivedMessages", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "CapSentMessages", + columns: table => new + { + Id = table.Column(nullable: false), + Added = table.Column(nullable: false), + Content = table.Column(nullable: true), + KeyName = table.Column(nullable: true), + LastRun = table.Column(nullable: false), + Retries = table.Column(nullable: false), + StateName = table.Column(maxLength: 50, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_CapSentMessages", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "CapReceivedMessages"); + + migrationBuilder.DropTable( + name: "CapSentMessages"); + } + } +} diff --git a/test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/TestDbContextModelSnapshot.cs b/test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/TestDbContextModelSnapshot.cs new file mode 100644 index 0000000..622471c --- /dev/null +++ b/test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/TestDbContextModelSnapshot.cs @@ -0,0 +1,66 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using DotNetCore.CAP.EntityFrameworkCore.Test; + +namespace DotNetCore.CAP.EntityFrameworkCore.Test.Migrations +{ + [DbContext(typeof(TestDbContext))] + partial class TestDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "1.1.2") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("DotNetCore.CAP.Infrastructure.CapReceivedMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Added"); + + b.Property("Content"); + + b.Property("KeyName"); + + b.Property("LastRun"); + + b.Property("Retries"); + + b.Property("StateName") + .HasMaxLength(50); + + b.HasKey("Id"); + + b.ToTable("CapReceivedMessages"); + }); + + modelBuilder.Entity("DotNetCore.CAP.Infrastructure.CapSentMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Added"); + + b.Property("Content"); + + b.Property("KeyName"); + + b.Property("LastRun"); + + b.Property("Retries"); + + b.Property("StateName") + .HasMaxLength(50); + + b.HasKey("Id"); + + b.ToTable("CapSentMessages"); + }); + } + } +} diff --git a/test/DotNetCore.CAP.EntityFrameworkCore.Test/TestDbContext.cs b/test/DotNetCore.CAP.EntityFrameworkCore.Test/TestDbContext.cs new file mode 100644 index 0000000..5684692 --- /dev/null +++ b/test/DotNetCore.CAP.EntityFrameworkCore.Test/TestDbContext.cs @@ -0,0 +1,13 @@ +using Microsoft.EntityFrameworkCore; + +namespace DotNetCore.CAP.EntityFrameworkCore.Test +{ + public class TestDbContext : CapDbContext + { + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + var connectionString = ConnectionUtil.GetConnectionString(); + optionsBuilder.UseSqlServer(connectionString); + } + } +}