Browse Source

新增 Table OCMF

Jessica Tseng 2 years ago
parent
commit
f59400038e

+ 3 - 3
EVCB_OCPP.Domain/App.config

@@ -15,9 +15,9 @@
     </providers>
   </entityFramework>
   <connectionStrings>
-    <add name="ConnectionLogDBContext" connectionString="data source=172.1.2.187,1434\SQLEXPRESS2017;initial catalog=StandardOCPP_ConnectionLog;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
-    <add name="MainDBContext" connectionString="data source=172.1.2.187\SQLEXPRESS2017;initial catalog=StandardOCPP_Main;;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
-    <add name="MeterValueDBContext" connectionString="data source=172.1.2.187\SQLEXPRESS2017;initial catalog=StandardOCPP_MeterValue;;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+    <add name="ConnectionLogDBContext" connectionString="data source=172.1.2.187;initial catalog=StandardOCPP_ConnectionLog;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+    <add name="MainDBContext" connectionString="data source=172.1.2.187;initial catalog=StandardOCPP_Main;;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
+    <add name="MeterValueDBContext" connectionString="data source=172.1.2.187;initial catalog=StandardOCPP_MeterValue;;persist security info=True;user id=sa;password=Ph0930118811;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
    
 </connectionStrings>
 </configuration>

+ 8 - 0
EVCB_OCPP.Domain/EVCB_OCPP.Domain.csproj

@@ -242,6 +242,10 @@
     <Compile Include="MainDBContextMigrations\202203290753486_AddFields_Tx_StopReason.Designer.cs">
       <DependentUpon>202203290753486_AddFields_Tx_StopReason.cs</DependentUpon>
     </Compile>
+    <Compile Include="MainDBContextMigrations\202208100229183_Add_Table_OCMF.cs" />
+    <Compile Include="MainDBContextMigrations\202208100229183_Add_Table_OCMF.Designer.cs">
+      <DependentUpon>202208100229183_Add_Table_OCMF.cs</DependentUpon>
+    </Compile>
     <Compile Include="MainDBContextMigrations\Configuration.cs" />
     <Compile Include="MeterValueDBContext.cs" />
     <Compile Include="MeterValueDBContextMigrations\201907150814558_Init.cs" />
@@ -279,6 +283,7 @@
     <Compile Include="Models\Database\MachineError.cs" />
     <Compile Include="Models\Database\MachineOperateRecord.cs" />
     <Compile Include="Models\Database\MachineVersionFile.cs" />
+    <Compile Include="Models\Database\OCMF.cs" />
     <Compile Include="Models\Database\ServerMessage.cs" />
     <Compile Include="Models\Database\TransactionRecord.cs" />
     <Compile Include="Models\Database\UploadFile.cs" />
@@ -432,6 +437,9 @@
     <EmbeddedResource Include="MainDBContextMigrations\202203290753486_AddFields_Tx_StopReason.resx">
       <DependentUpon>202203290753486_AddFields_Tx_StopReason.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="MainDBContextMigrations\202208100229183_Add_Table_OCMF.resx">
+      <DependentUpon>202208100229183_Add_Table_OCMF.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="MeterValueDBContextMigrations\201907150814558_Init.resx">
       <DependentUpon>201907150814558_Init.cs</DependentUpon>
     </EmbeddedResource>

+ 1 - 1
EVCB_OCPP.Domain/MainDBContext.cs

@@ -36,7 +36,7 @@
         // 針對您要包含在模型中的每種實體類型新增 DbSet。如需有關設定和使用
         // Code First 模型的詳細資訊,請參閱 http://go.microsoft.com/fwlink/?LinkId=390109。
 
-
+        public virtual DbSet<OCMF> OCMF { get; set; }
 
         public virtual DbSet<ConnectorStatus> ConnectorStatus { get; set; }
 

+ 29 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/202208100229183_Add_Table_OCMF.Designer.cs

@@ -0,0 +1,29 @@
+// <auto-generated />
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System.CodeDom.Compiler;
+    using System.Data.Entity.Migrations;
+    using System.Data.Entity.Migrations.Infrastructure;
+    using System.Resources;
+    
+    [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
+    public sealed partial class Add_Table_OCMF : IMigrationMetadata
+    {
+        private readonly ResourceManager Resources = new ResourceManager(typeof(Add_Table_OCMF));
+        
+        string IMigrationMetadata.Id
+        {
+            get { return "202208100229183_Add_Table_OCMF"; }
+        }
+        
+        string IMigrationMetadata.Source
+        {
+            get { return null; }
+        }
+        
+        string IMigrationMetadata.Target
+        {
+            get { return Resources.GetString("Target"); }
+        }
+    }
+}

+ 28 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/202208100229183_Add_Table_OCMF.cs

@@ -0,0 +1,28 @@
+namespace EVCB_OCPP.Domain.MainDBContextMigrations
+{
+    using System;
+    using System.Data.Entity.Migrations;
+    
+    public partial class Add_Table_OCMF : DbMigration
+    {
+        public override void Up()
+        {
+            CreateTable(
+                "dbo.OCMF",
+                c => new
+                    {
+                        Id = c.Int(nullable: false, identity: true),
+                        TransactionId = c.Int(nullable: false),
+                        DataString = c.String(maxLength: 2048),
+                        PublicKey = c.String(maxLength: 256),
+                    })
+                .PrimaryKey(t => t.Id);
+            
+        }
+        
+        public override void Down()
+        {
+            DropTable("dbo.OCMF");
+        }
+    }
+}

File diff suppressed because it is too large
+ 120 - 0
EVCB_OCPP.Domain/MainDBContextMigrations/202208100229183_Add_Table_OCMF.resx


+ 28 - 0
EVCB_OCPP.Domain/Models/Database/OCMF.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.Domain.Models.Database
+{
+    [Table("OCMF")]
+    public class OCMF
+    {
+        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+        [Key]
+        public Int32 Id { get; set; }
+
+
+        public Int32 TransactionId { get; set; }
+
+
+        [StringLength(2048)]
+        public string DataString { set; get; }
+
+        [StringLength(256)]
+        public string PublicKey { set; get; }
+    }
+}

+ 1 - 1
EVCB_OCPP.Domain/Properties/AssemblyInfo.cs

@@ -35,4 +35,4 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyVersion("0.1.0.0")]
 [assembly: AssemblyFileVersion("0.1.0.0")]
 
-[assembly: AssemblyInformationalVersion("05230de")]
+[assembly: AssemblyInformationalVersion("a7497c4")]

Some files were not shown because too many files changed in this diff