| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- namespace WePlatform.Migrations
- {
- using System;
- using System.Collections.Generic;
- using System.Data.Entity.Infrastructure.Annotations;
- using System.Data.Entity.Migrations;
-
- public partial class AddComponent : DbMigration
- {
- public override void Up()
- {
- CreateTable(
- "dbo.WeModel_Components",
- c => new
- {
- Id = c.String(nullable: false, maxLength: 128),
- Name = c.String(maxLength: 50),
- Parameters = c.String(maxLength: 1000),
- Description = c.String(maxLength: 500),
- ComponentScript = c.String(),
- ComponentClass = c.String(maxLength: 100),
- ComponentLib = c.String(maxLength: 100),
- RegisterKey = c.String(maxLength: 100),
- Remark = c.String(maxLength: 500),
- IsDeleted = c.Boolean(nullable: false),
- DeleterUserId = c.Long(),
- DeletionTime = c.DateTime(),
- LastModificationTime = c.DateTime(),
- LastModifierUserId = c.Long(),
- CreationTime = c.DateTime(nullable: false),
- CreatorUserId = c.Long(),
- },
- annotations: new Dictionary<string, object>
- {
- { "DynamicFilter_EngineComponentInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
- })
- .PrimaryKey(t => t.Id)
- .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
- .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId)
- .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
- .Index(t => t.IsDeleted)
- .Index(t => t.DeleterUserId)
- .Index(t => t.LastModifierUserId)
- .Index(t => t.CreatorUserId);
-
- AddColumn("dbo.WeModel_Engines", "EngineTypeName", c => c.String(maxLength: 50));
- DropColumn("dbo.WeModel_Engines", "RunnerClassName");
- DropColumn("dbo.WeModel_Engines", "ScoreEvalClassName");
- }
-
- public override void Down()
- {
- AddColumn("dbo.WeModel_Engines", "ScoreEvalClassName", c => c.String(maxLength: 200));
- AddColumn("dbo.WeModel_Engines", "RunnerClassName", c => c.String(maxLength: 200));
- DropForeignKey("dbo.WeModel_Components", "LastModifierUserId", "dbo.Sys_Users");
- DropForeignKey("dbo.WeModel_Components", "DeleterUserId", "dbo.Sys_Users");
- DropForeignKey("dbo.WeModel_Components", "CreatorUserId", "dbo.Sys_Users");
- DropIndex("dbo.WeModel_Components", new[] { "CreatorUserId" });
- DropIndex("dbo.WeModel_Components", new[] { "LastModifierUserId" });
- DropIndex("dbo.WeModel_Components", new[] { "DeleterUserId" });
- DropIndex("dbo.WeModel_Components", new[] { "IsDeleted" });
- DropColumn("dbo.WeModel_Engines", "EngineTypeName");
- DropTable("dbo.WeModel_Components",
- removedAnnotations: new Dictionary<string, object>
- {
- { "DynamicFilter_EngineComponentInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
- });
- }
- }
- }
|