@@ -42,10 +42,11 @@ public partial class IRCContext : DbContext
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseSqlServer("Server=106.14.89.110,1433;Database=IRC_Code;User ID=sa;Password=mssql_KnTs2a;TrustServerCertificate=true");
|
||||
|
||||
//移除外键约束
|
||||
optionsBuilder.ReplaceService<IMigrationsSqlGenerator, MigrationRemoveForeignKeysSqlGenerator>();
|
||||
optionsBuilder.UseSqlServer("Server=106.14.89.110,1433;Database=IRC_Code;User ID=sa;Password=mssql_KnTs2a;TrustServerCertificate=true");
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
[DbContext(typeof(IRCContext))]
|
||||
[Migration("20240911151956_RemoveForeignKeys")]
|
||||
partial class RemoveForeignKeys
|
||||
[Migration("20240912012757_RemoveForeignKey")]
|
||||
partial class RemoveForeignKey
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
+1
-1
@@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class RemoveForeignKeys : Migration
|
||||
public partial class RemoveForeignKey : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
Reference in New Issue
Block a user