From 3a521ade2b23977d3a4c31f2e8653021ae156942 Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Sat, 3 Sep 2022 19:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E3=80=82=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20220903110918_renamefield.Designer.cs | 357 ++++++++++++++++++ Data/Migrations/20220903110918_renamefield.cs | 36 ++ .../ApplicationDbContextModelSnapshot.cs | 11 +- IoTSharp.Gateways.csproj | 4 +- 4 files changed, 399 insertions(+), 9 deletions(-) create mode 100644 Data/Migrations/20220903110918_renamefield.Designer.cs create mode 100644 Data/Migrations/20220903110918_renamefield.cs diff --git a/Data/Migrations/20220903110918_renamefield.Designer.cs b/Data/Migrations/20220903110918_renamefield.Designer.cs new file mode 100644 index 0000000..3374755 --- /dev/null +++ b/Data/Migrations/20220903110918_renamefield.Designer.cs @@ -0,0 +1,357 @@ +// +using System; +using IoTSharp.Gateways.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace IoTSharp.Gateways.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20220903110918_renamefield")] + partial class renamefield + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "6.0.8"); + + modelBuilder.Entity("IoTSharp.Gateways.Data.ModbusSlave", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("DeviceName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DeviceNameFormat") + .HasColumnType("TEXT"); + + b.Property("Slave") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TimeInterval") + .HasColumnType("REAL"); + + b.Property("TimeOut") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("ModbusSlaves"); + }); + + modelBuilder.Entity("IoTSharp.Gateways.Data.PointMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Address") + .HasColumnType("INTEGER"); + + b.Property("CodePage") + .HasColumnType("INTEGER"); + + b.Property("DataCatalog") + .HasColumnType("INTEGER"); + + b.Property("DataFormat") + .HasColumnType("TEXT"); + + b.Property("DataName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DataType") + .HasColumnType("INTEGER"); + + b.Property("FunCode") + .HasColumnType("INTEGER"); + + b.Property("Length") + .HasColumnType("INTEGER"); + + b.Property("OwnerId") + .HasColumnType("TEXT"); + + b.Property("SlaveCode") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("PointMappings"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ClaimType") + .HasColumnType("TEXT"); + + b.Property("ClaimValue") + .HasColumnType("TEXT"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("AccessFailedCount") + .HasColumnType("INTEGER"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("EmailConfirmed") + .HasColumnType("INTEGER"); + + b.Property("LockoutEnabled") + .HasColumnType("INTEGER"); + + b.Property("LockoutEnd") + .HasColumnType("TEXT"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("PasswordHash") + .HasColumnType("TEXT"); + + b.Property("PhoneNumber") + .HasColumnType("TEXT"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("INTEGER"); + + b.Property("SecurityStamp") + .HasColumnType("TEXT"); + + b.Property("TwoFactorEnabled") + .HasColumnType("INTEGER"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ClaimType") + .HasColumnType("TEXT"); + + b.Property("ClaimValue") + .HasColumnType("TEXT"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("ProviderKey") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("ProviderDisplayName") + .HasColumnType("TEXT"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("TEXT"); + + b.Property("RoleId") + .HasColumnType("TEXT"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("TEXT"); + + b.Property("LoginProvider") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("Value") + .HasColumnType("TEXT"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("IoTSharp.Gateways.Data.PointMapping", b => + { + b.HasOne("IoTSharp.Gateways.Data.ModbusSlave", "Owner") + .WithMany("PointMappings") + .HasForeignKey("OwnerId"); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IoTSharp.Gateways.Data.ModbusSlave", b => + { + b.Navigation("PointMappings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Data/Migrations/20220903110918_renamefield.cs b/Data/Migrations/20220903110918_renamefield.cs new file mode 100644 index 0000000..fc52fce --- /dev/null +++ b/Data/Migrations/20220903110918_renamefield.cs @@ -0,0 +1,36 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace IoTSharp.Gateways.Migrations +{ + public partial class renamefield : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Cycles", + table: "PointMappings"); + + migrationBuilder.RenameColumn( + name: "DateTimeFormat", + table: "PointMappings", + newName: "DataFormat"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "DataFormat", + table: "PointMappings", + newName: "DateTimeFormat"); + + migrationBuilder.AddColumn( + name: "Cycles", + table: "PointMappings", + type: "INTEGER", + nullable: false, + defaultValue: 0); + } + } +} diff --git a/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/Data/Migrations/ApplicationDbContextModelSnapshot.cs index b3b806f..c3ded12 100644 --- a/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ namespace IoTSharp.Gateways.Migrations protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "6.0.7"); + modelBuilder.HasAnnotation("ProductVersion", "6.0.8"); modelBuilder.Entity("IoTSharp.Gateways.Data.ModbusSlave", b => { @@ -57,12 +57,12 @@ namespace IoTSharp.Gateways.Migrations b.Property("CodePage") .HasColumnType("INTEGER"); - b.Property("Cycles") - .HasColumnType("INTEGER"); - b.Property("DataCatalog") .HasColumnType("INTEGER"); + b.Property("DataFormat") + .HasColumnType("TEXT"); + b.Property("DataName") .IsRequired() .HasColumnType("TEXT"); @@ -70,9 +70,6 @@ namespace IoTSharp.Gateways.Migrations b.Property("DataType") .HasColumnType("INTEGER"); - b.Property("DateTimeFormat") - .HasColumnType("TEXT"); - b.Property("FunCode") .HasColumnType("INTEGER"); diff --git a/IoTSharp.Gateways.csproj b/IoTSharp.Gateways.csproj index 2f9cbb7..f8e0933 100644 --- a/IoTSharp.Gateways.csproj +++ b/IoTSharp.Gateways.csproj @@ -28,9 +28,9 @@ - + - +