namespace ContractService.Migrations { using System; using System.Collections.Generic; using System.Data.Entity.Infrastructure.Annotations; using System.Data.Entity.Migrations; public partial class InitCreate : DbMigration { public override void Up() { CreateTable( "dbo.Cs_ClientCompanies", c => new { Id = c.String(nullable: false, maxLength: 128), Name = c.String(maxLength: 50), DisplayName = c.String(maxLength: 50), Description = c.String(maxLength: 500), Remark = c.String(maxLength: 1000), 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 { { "DynamicFilter_ClientCompanyInfo_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); CreateTable( "dbo.Sys_Users", c => new { Id = c.Long(nullable: false, identity: true), NormalizedUserName = c.String(nullable: false, maxLength: 256), NormalizedEmailAddress = c.String(nullable: false, maxLength: 256), ConcurrencyStamp = c.String(maxLength: 128), AuthenticationSource = c.String(maxLength: 64), UserName = c.String(nullable: false, maxLength: 256), UserType = c.Int(nullable: false), AccountType = c.Int(), AccountNo = c.String(maxLength: 100), ImagePath = c.String(maxLength: 1000), TenantId = c.Int(), EmailAddress = c.String(nullable: false, maxLength: 256), Name = c.String(nullable: false, maxLength: 64), Surname = c.String(maxLength: 64), AvatarImagePath = c.String(maxLength: 500), Password = c.String(nullable: false, maxLength: 128), EmailConfirmationCode = c.String(maxLength: 328), PasswordResetCode = c.String(maxLength: 328), LockoutEndDateUtc = c.DateTime(), AccessFailedCount = c.Int(nullable: false), IsLockoutEnabled = c.Boolean(nullable: false), PhoneNumber = c.String(maxLength: 32), IsPhoneNumberConfirmed = c.Boolean(nullable: false), SecurityStamp = c.String(maxLength: 128), IsTwoFactorEnabled = c.Boolean(nullable: false), IsEmailConfirmed = c.Boolean(nullable: false), IsActive = c.Boolean(nullable: false), 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 { { "DynamicFilter_User_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, { "DynamicFilter_User_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.UserName) .Index(t => t.UserType) .Index(t => t.AccountType) .Index(t => t.TenantId) .Index(t => t.EmailAddress) .Index(t => t.PhoneNumber) .Index(t => t.IsDeleted) .Index(t => t.DeleterUserId) .Index(t => t.LastModifierUserId) .Index(t => t.CreatorUserId); CreateTable( "dbo.Sys_UserClaims", c => new { Id = c.Long(nullable: false, identity: true), TenantId = c.Int(), UserId = c.Long(nullable: false), ClaimType = c.String(maxLength: 256), ClaimValue = c.String(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_UserClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Sys_Users", t => t.UserId) .Index(t => t.TenantId) .Index(t => t.UserId); CreateTable( "dbo.Sys_UserLogins", c => new { Id = c.Long(nullable: false, identity: true), TenantId = c.Int(), UserId = c.Long(nullable: false), LoginProvider = c.String(nullable: false, maxLength: 128), ProviderKey = c.String(nullable: false, maxLength: 256), }, annotations: new Dictionary { { "DynamicFilter_UserLogin_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Sys_Users", t => t.UserId) .Index(t => t.TenantId) .Index(t => t.UserId); CreateTable( "dbo.Sys_UserRoles", c => new { Id = c.Long(nullable: false, identity: true), TenantId = c.Int(), UserId = c.Long(nullable: false), RoleId = c.Int(nullable: false), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_UserRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Sys_Users", t => t.UserId) .Index(t => t.TenantId) .Index(t => t.UserId); CreateTable( "dbo.Sys_Settings", c => new { Id = c.Long(nullable: false, identity: true), TenantId = c.Int(), UserId = c.Long(), Name = c.String(nullable: false, maxLength: 256), Value = c.String(), DisplayName = c.String(maxLength: 50), Type = c.Int(), Description = c.String(maxLength: 500), Remark = c.String(maxLength: 500), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_SysSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Sys_Users", t => t.UserId) .Index(t => new { t.TenantId, t.Name, t.UserId }, unique: true); CreateTable( "dbo.Cs_ClientOrganizations", c => new { Id = c.String(nullable: false, maxLength: 128), ParentNo = c.String(maxLength: 128), Name = c.String(maxLength: 50), Description = c.String(maxLength: 500), Path = c.String(maxLength: 1000), Sort = c.Int(nullable: false), CompanyNo = c.String(maxLength: 128), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Cs_ClientCompanies", t => t.CompanyNo) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .ForeignKey("dbo.Cs_ClientOrganizations", t => t.ParentNo) .Index(t => t.ParentNo) .Index(t => t.CompanyNo) .Index(t => t.CreatorUserId); CreateTable( "dbo.Cs_ClientStaffs", c => new { Id = c.String(nullable: false, maxLength: 128), Code = c.String(maxLength: 50), Name = c.String(maxLength: 50), Profile = c.String(maxLength: 500), Birthday = c.DateTime(), IdCard = c.String(maxLength: 20), PhoneNumber = c.String(maxLength: 20), PhoneNumber2 = c.String(maxLength: 20), UserName = c.String(maxLength: 20), CompanyNo = c.String(maxLength: 128), OrganizationNo = c.String(maxLength: 128), Email = c.String(maxLength: 50), Remark = c.String(maxLength: 1000), 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 { { "DynamicFilter_ClientStaffInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Cs_ClientCompanies", t => t.CompanyNo) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId) .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId) .ForeignKey("dbo.Cs_ClientOrganizations", t => t.OrganizationNo) .Index(t => t.CompanyNo) .Index(t => t.OrganizationNo) .Index(t => t.IsDeleted) .Index(t => t.DeleterUserId) .Index(t => t.LastModifierUserId) .Index(t => t.CreatorUserId); CreateTable( "dbo.Sys_Permissions", c => new { Id = c.Long(nullable: false, identity: true), TenantId = c.Int(), Name = c.String(nullable: false, maxLength: 500), Master = c.Int(), MasterValue = c.String(maxLength: 100), Access = c.Int(), AccessValue = c.String(maxLength: 500), IsGranted = c.Boolean(nullable: false), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), UserId = c.Long(), Discriminator = c.String(nullable: false, maxLength: 128), }, annotations: new Dictionary { { "DynamicFilter_DataPermission_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, { "DynamicFilter_PermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, { "DynamicFilter_RolePermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, { "DynamicFilter_UserPermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .Index(t => t.TenantId); CreateTable( "dbo.Ls_LawFirms", c => new { Id = c.String(nullable: false, maxLength: 128), Name = c.String(maxLength: 50), DisplayName = c.String(maxLength: 50), Description = c.String(maxLength: 500), Remark = c.String(maxLength: 1000), 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 { { "DynamicFilter_LawFirmInfo_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); CreateTable( "dbo.Ls_Lawyers", c => new { Id = c.String(nullable: false, maxLength: 128), Code = c.String(maxLength: 50), Name = c.String(maxLength: 50), Profile = c.String(maxLength: 500), Email = c.String(maxLength: 50), Birthday = c.DateTime(), IdCard = c.String(maxLength: 20), PhoneNumber = c.String(maxLength: 20), PhoneNumber2 = c.String(maxLength: 20), UserName = c.String(maxLength: 20), Remark = c.String(maxLength: 1000), 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 { { "DynamicFilter_LawyerInfo_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); CreateTable( "dbo.Ls_LawyerRelatedInfos", c => new { Id = c.Int(nullable: false, identity: true), LawyerNo = c.String(nullable: false, maxLength: 128), RelatedType = c.Int(nullable: false), MasterType = c.Int(nullable: false), LawFirmNo = c.String(maxLength: 128), CaseNo = c.String(maxLength: 128), ContractNo = c.String(maxLength: 128), Remark = c.String(maxLength: 1000), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Ls_LegalCases", t => t.CaseNo) .ForeignKey("dbo.Ls_LegalContracts", t => t.ContractNo) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .ForeignKey("dbo.Ls_LawFirms", t => t.LawFirmNo) .ForeignKey("dbo.Ls_Lawyers", t => t.LawyerNo) .Index(t => t.LawyerNo) .Index(t => t.RelatedType) .Index(t => t.MasterType) .Index(t => t.LawFirmNo) .Index(t => t.CaseNo) .Index(t => t.ContractNo) .Index(t => t.CreatorUserId); CreateTable( "dbo.Ls_LegalCases", c => new { Id = c.String(nullable: false, maxLength: 128), Code = c.String(maxLength: 50), Name = c.String(maxLength: 50), Tags = c.String(maxLength: 200), Description = c.String(maxLength: 500), ServiceLevel = c.Int(nullable: false), CaseState = c.Int(nullable: false), ServiceType = c.String(maxLength: 128), StartDateTime = c.DateTime(), EndDateTime = c.DateTime(), StateLastChangeTime = c.DateTime(), StateLastChangeCause = c.String(maxLength: 500), Remark = c.String(maxLength: 1000), CompanyNo = c.String(maxLength: 128), 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 { { "DynamicFilter_LegalCaseInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Cs_ClientCompanies", t => t.CompanyNo) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId) .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId) .ForeignKey("dbo.Base_LegalServiceTypes", t => t.ServiceType) .Index(t => t.ServiceType) .Index(t => t.CompanyNo) .Index(t => t.IsDeleted) .Index(t => t.DeleterUserId) .Index(t => t.LastModifierUserId) .Index(t => t.CreatorUserId); CreateTable( "dbo.Base_LegalServiceTypes", c => new { Id = c.String(nullable: false, maxLength: 128), ParentNo = c.String(maxLength: 128), Name = c.String(maxLength: 50), Description = c.String(maxLength: 500), ServiceTypePath = c.String(maxLength: 500), IsActive = c.Boolean(nullable: false), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id); CreateTable( "dbo.Ls_LegalContracts", c => new { Id = c.String(nullable: false, maxLength: 128), Code = c.String(maxLength: 50), Name = c.String(maxLength: 50), Tags = c.String(maxLength: 200), ContractState = c.Int(nullable: false), StartDateTime = c.DateTime(), EndDateTime = c.DateTime(), StateLastChangeTime = c.DateTime(), StateLastChangeCause = c.String(maxLength: 500), CaseNo = c.String(maxLength: 128), Remark = c.String(maxLength: 1000), 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 { { "DynamicFilter_LegalContractInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Ls_LegalCases", t => t.CaseNo) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .ForeignKey("dbo.Sys_Users", t => t.DeleterUserId) .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId) .Index(t => t.CaseNo) .Index(t => t.IsDeleted) .Index(t => t.DeleterUserId) .Index(t => t.LastModifierUserId) .Index(t => t.CreatorUserId); CreateTable( "dbo.Ls_LegalContractContents", c => new { Id = c.Long(nullable: false, identity: true), No = c.String(maxLength: 128), ContentInfo = c.String(), Remark = c.String(maxLength: 1000), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .Index(t => t.CreatorUserId); CreateTable( "dbo.Ls_LegalContractKeyPoints", c => new { Id = c.String(nullable: false, maxLength: 128), ParentNo = c.String(maxLength: 128), Name = c.String(maxLength: 50), Tags = c.String(maxLength: 200), Description = c.String(maxLength: 500), KeyPointLevel = c.Int(nullable: false), KeyPointState = c.Int(nullable: false), ExpireDate = c.DateTime(), AlarmDate = c.DateTime(), ExecuteDate = c.DateTime(), ExpireDay = c.Int(nullable: false), AlarmDay = c.Int(nullable: false), KeyPointPath = c.String(maxLength: 500), ContractNo = c.String(maxLength: 128), Remark = c.String(maxLength: 1000), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Ls_LegalContracts", t => t.ContractNo) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId) .ForeignKey("dbo.Ls_LegalContractKeyPoints", t => t.ParentNo) .Index(t => t.ParentNo) .Index(t => t.ContractNo) .Index(t => t.LastModifierUserId) .Index(t => t.CreatorUserId); CreateTable( "dbo.Ls_LegalContractNotes", c => new { Id = c.Long(nullable: false, identity: true), ContractNo = c.String(maxLength: 128), KeyPointNo = c.String(maxLength: 128), IsLawyer = c.Boolean(nullable: false), NoteContent = c.String(maxLength: 1000), Remark = c.String(maxLength: 1000), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Ls_LegalContracts", t => t.ContractNo) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .ForeignKey("dbo.Ls_LegalContractKeyPoints", t => t.KeyPointNo) .Index(t => t.ContractNo) .Index(t => t.KeyPointNo) .Index(t => t.CreatorUserId); CreateTable( "dbo.Ls_LegalContractSupplements", c => new { Id = c.String(nullable: false, maxLength: 128), Code = c.String(maxLength: 50), Name = c.String(maxLength: 50), ContractNo = c.String(maxLength: 128), Remark = c.String(maxLength: 1000), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Ls_LegalContracts", t => t.ContractNo) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .Index(t => t.ContractNo) .Index(t => t.CreatorUserId); CreateTable( "dbo.Ls_LegalCaseNotes", c => new { Id = c.Long(nullable: false, identity: true), CaseNo = c.String(maxLength: 128), NoteContent = c.String(maxLength: 1000), Remark = c.String(maxLength: 1000), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Ls_LegalCases", t => t.CaseNo) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .Index(t => t.CaseNo) .Index(t => t.CreatorUserId); CreateTable( "dbo.Sys_Notifications", c => new { Id = c.Guid(nullable: false), NotificationName = c.String(nullable: false, maxLength: 96), Data = c.String(), DataTypeName = c.String(maxLength: 512), EntityTypeName = c.String(maxLength: 250), EntityTypeAssemblyQualifiedName = c.String(maxLength: 512), EntityId = c.String(maxLength: 96), Severity = c.Byte(nullable: false), UserIds = c.String(), ExcludedUserIds = c.String(), TenantIds = c.String(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id); CreateTable( "dbo.Sys_NotificationSubscriptions", c => new { Id = c.Guid(nullable: false), TenantId = c.Int(), UserId = c.Long(nullable: false), NotificationName = c.String(maxLength: 96), EntityTypeName = c.String(maxLength: 250), EntityTypeAssemblyQualifiedName = c.String(maxLength: 512), EntityId = c.String(maxLength: 96), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_NotificationSubscriptionInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .Index(t => t.TenantId) .Index(t => new { t.NotificationName, t.EntityTypeName, t.EntityId, t.UserId }); CreateTable( "dbo.Sys_Roles", c => new { Id = c.Int(nullable: false, identity: true), Description = c.String(), NormalizedName = c.String(nullable: false, maxLength: 32), ConcurrencyStamp = c.String(maxLength: 128), TenantId = c.Int(), Name = c.String(nullable: false, maxLength: 32), RoleType = c.Int(nullable: false), AccountType = c.Int(), DisplayName = c.String(nullable: false, maxLength: 64), IsStatic = c.Boolean(nullable: false), IsDefault = c.Boolean(nullable: false), 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 { { "DynamicFilter_Role_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, { "DynamicFilter_Role_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.TenantId) .Index(t => t.Name) .Index(t => t.RoleType) .Index(t => t.AccountType) .Index(t => t.IsDeleted) .Index(t => t.DeleterUserId) .Index(t => t.LastModifierUserId) .Index(t => t.CreatorUserId); CreateTable( "dbo.Sys_RoleClaims", c => new { Id = c.Long(nullable: false, identity: true), TenantId = c.Int(), RoleId = c.Int(nullable: false), ClaimType = c.String(maxLength: 256), ClaimValue = c.String(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_RoleClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Sys_Roles", t => t.RoleId) .Index(t => t.TenantId) .Index(t => t.RoleId); CreateTable( "dbo.Cs_StaffRelateInfos", c => new { Id = c.Int(nullable: false, identity: true), StaffNo = c.String(maxLength: 128), CompanyNo = c.String(maxLength: 128), CaseNo = c.String(maxLength: 128), ContractNo = c.String(maxLength: 128), RelatedType = c.Int(nullable: false), MasterType = c.Int(nullable: false), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Ls_LegalCases", t => t.CaseNo) .ForeignKey("dbo.Cs_ClientCompanies", t => t.CompanyNo) .ForeignKey("dbo.Ls_LegalContracts", t => t.ContractNo) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .ForeignKey("dbo.Cs_ClientStaffs", t => t.StaffNo) .Index(t => t.StaffNo) .Index(t => t.CompanyNo) .Index(t => t.CaseNo) .Index(t => t.ContractNo) .Index(t => t.CreatorUserId); CreateTable( "dbo.Sys_AppGuids", c => new { Id = c.Int(nullable: false, identity: true), Step = c.Short(nullable: false), LastId = c.Int(nullable: false), IdType = c.Short(nullable: false), LastUseDate = c.DateTime(), }) .PrimaryKey(t => t.Id) .Index(t => t.IdType); CreateTable( "dbo.Sys_AttachFiles", c => new { Id = c.Int(nullable: false, identity: true), AttachNo = c.String(maxLength: 32), TableName = c.String(maxLength: 50), ColumnName = c.String(maxLength: 50), SourceKey = c.String(maxLength: 50), FileTitle = c.String(maxLength: 50), FileName = c.String(maxLength: 50), FilePath = c.String(maxLength: 500), FileType = c.String(maxLength: 20), FileExt = c.String(maxLength: 10), Description = c.String(maxLength: 500), TenantId = c.Int(nullable: false), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_SysAttachFile_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .Index(t => t.TenantId) .Index(t => t.CreatorUserId); CreateTable( "dbo.Sys_Functions", c => new { Id = c.Int(nullable: false, identity: true), FunctionNo = c.String(maxLength: 100), ParentNo = c.String(maxLength: 100), FunctionName = c.String(maxLength: 100), PermissionName = c.String(maxLength: 500), FunctionType = c.Int(nullable: false), Action = c.String(maxLength: 50), Controller = c.String(maxLength: 50), Url = c.String(), Icon = c.String(maxLength: 20), Class = c.String(maxLength: 100), Script = c.String(), NeedAuth = c.Boolean(nullable: false), Sort = c.Int(nullable: false), Depth = c.Int(nullable: false), IsLeaf = c.Boolean(), 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 { { "DynamicFilter_SysFunction_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.FunctionNo) .Index(t => t.PermissionName, unique: true) .Index(t => t.IsDeleted) .Index(t => t.DeleterUserId) .Index(t => t.LastModifierUserId) .Index(t => t.CreatorUserId); CreateTable( "dbo.Sys_SysHelps", c => new { Id = c.Int(nullable: false, identity: true), Classification = c.String(maxLength: 40), HelpTitle = c.String(nullable: false, maxLength: 50), HelpKeyWords = c.String(maxLength: 50), HelpContent = c.String(), FunctionNo = c.String(maxLength: 100), PermissionName = c.String(maxLength: 500), Sequence = c.Int(nullable: false), Description = c.String(), Remark = c.String(maxLength: 1000), 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 { { "DynamicFilter_SysHelp_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); CreateTable( "dbo.Sys_AuditLogs", c => new { Id = c.Long(nullable: false, identity: true), TenantId = c.Int(nullable: false), UserId = c.Long(), UserName = c.String(), ServiceName = c.String(maxLength: 256), ServiceNameLang = c.String(), MethodName = c.String(maxLength: 256), MethodNameLang = c.String(), Parameters = c.String(maxLength: 1024), ExecutionTime = c.DateTime(nullable: false), ExecutionDuration = c.Int(nullable: false), ClientIpAddress = c.String(maxLength: 64), ClientName = c.String(maxLength: 128), BrowserInfo = c.String(maxLength: 512), Exception = c.String(maxLength: 2000), ImpersonatorUserId = c.Long(), ImpersonatorTenantId = c.Int(), CustomData = c.String(maxLength: 2000), LogType = c.Int(nullable: false), }, annotations: new Dictionary { { "DynamicFilter_SysLog_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .Index(t => t.TenantId) .Index(t => t.UserId); CreateTable( "dbo.Sys_QueryInfos", c => new { Id = c.Int(nullable: false, identity: true), TableKey = c.String(maxLength: 30), ColumnKey = c.String(maxLength: 30), ValueKey = c.String(maxLength: 100), NameKey = c.String(maxLength: 100), UseCount = c.Int(nullable: false), LastUseDate = c.DateTime(nullable: false), ExtensionData = c.String(), Remark = c.String(maxLength: 500), }) .PrimaryKey(t => t.Id) .Index(t => t.TableKey) .Index(t => t.ColumnKey) .Index(t => t.ValueKey) .Index(t => t.NameKey); CreateTable( "dbo.Sys_States", c => new { Id = c.Int(nullable: false, identity: true), StateNo = c.String(maxLength: 32), StateName = c.String(maxLength: 50), TableName = c.String(nullable: false, maxLength: 50), ColumnName = c.String(nullable: false, maxLength: 50), CodeValue = c.String(nullable: false, maxLength: 100), DisplayValue = c.String(nullable: false, maxLength: 100), 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 { { "DynamicFilter_SysState_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); CreateTable( "dbo.Sys_NotificationTenants", c => new { Id = c.Guid(nullable: false), TenantId = c.Int(), NotificationName = c.String(nullable: false, maxLength: 96), Data = c.String(), DataTypeName = c.String(maxLength: 512), EntityTypeName = c.String(maxLength: 250), EntityTypeAssemblyQualifiedName = c.String(maxLength: 512), EntityId = c.String(maxLength: 96), Severity = c.Byte(nullable: false), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary { { "DynamicFilter_TenantNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .Index(t => t.TenantId); CreateTable( "dbo.Sys_Tenants", c => new { Id = c.Int(nullable: false, identity: true), TenancyName = c.String(nullable: false, maxLength: 64), Name = c.String(nullable: false, maxLength: 128), ConnectionString = c.String(maxLength: 1024), IsActive = c.Boolean(nullable: false), 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 { { "DynamicFilter_Tenant_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); CreateTable( "dbo.Sys_UserAccounts", c => new { Id = c.Long(nullable: false, identity: true), TenantId = c.Int(), UserId = c.Long(nullable: false), UserLinkId = c.Long(), UserName = c.String(maxLength: 256), EmailAddress = c.String(maxLength: 256), 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 { { "DynamicFilter_UserAccount_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .Index(t => t.IsDeleted); CreateTable( "dbo.Sys_UserLoginAttempts", c => new { Id = c.Long(nullable: false, identity: true), TenantId = c.Int(), TenancyName = c.String(maxLength: 64), UserId = c.Long(), UserNameOrEmailAddress = c.String(maxLength: 255), ClientIpAddress = c.String(maxLength: 64), ClientName = c.String(maxLength: 128), BrowserInfo = c.String(maxLength: 512), Result = c.Byte(nullable: false), CreationTime = c.DateTime(nullable: false), }, annotations: new Dictionary { { "DynamicFilter_UserLoginAttempt_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .Index(t => t.TenantId) .Index(t => new { t.UserId, t.TenantId }) .Index(t => new { t.TenancyName, t.UserNameOrEmailAddress, t.Result }); CreateTable( "dbo.Sys_NotificationUsers", c => new { Id = c.Guid(nullable: false), TenantId = c.Int(), UserId = c.Long(nullable: false), TenantNotificationId = c.Guid(nullable: false), State = c.Int(nullable: false), CreationTime = c.DateTime(nullable: false), }, annotations: new Dictionary { { "DynamicFilter_UserNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id) .Index(t => t.TenantId) .Index(t => new { t.UserId, t.State, t.CreationTime }); } public override void Down() { DropForeignKey("dbo.Sys_Tenants", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Tenants", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Tenants", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_States", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_States", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_States", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_SysHelps", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_SysHelps", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_SysHelps", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Functions", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Functions", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Functions", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_AttachFiles", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Cs_StaffRelateInfos", "StaffNo", "dbo.Cs_ClientStaffs"); DropForeignKey("dbo.Cs_StaffRelateInfos", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Cs_StaffRelateInfos", "ContractNo", "dbo.Ls_LegalContracts"); DropForeignKey("dbo.Cs_StaffRelateInfos", "CompanyNo", "dbo.Cs_ClientCompanies"); DropForeignKey("dbo.Cs_StaffRelateInfos", "CaseNo", "dbo.Ls_LegalCases"); DropForeignKey("dbo.Sys_Roles", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Roles", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Roles", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_RoleClaims", "RoleId", "dbo.Sys_Roles"); DropForeignKey("dbo.Ls_LegalCaseNotes", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalCaseNotes", "CaseNo", "dbo.Ls_LegalCases"); DropForeignKey("dbo.Ls_LegalContractSupplements", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalContractSupplements", "ContractNo", "dbo.Ls_LegalContracts"); DropForeignKey("dbo.Ls_LegalContractNotes", "KeyPointNo", "dbo.Ls_LegalContractKeyPoints"); DropForeignKey("dbo.Ls_LegalContractNotes", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalContractNotes", "ContractNo", "dbo.Ls_LegalContracts"); DropForeignKey("dbo.Ls_LegalContractKeyPoints", "ParentNo", "dbo.Ls_LegalContractKeyPoints"); DropForeignKey("dbo.Ls_LegalContractKeyPoints", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalContractKeyPoints", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalContractKeyPoints", "ContractNo", "dbo.Ls_LegalContracts"); DropForeignKey("dbo.Ls_LegalContractContents", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LawyerRelatedInfos", "LawyerNo", "dbo.Ls_Lawyers"); DropForeignKey("dbo.Ls_LawyerRelatedInfos", "LawFirmNo", "dbo.Ls_LawFirms"); DropForeignKey("dbo.Ls_LawyerRelatedInfos", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LawyerRelatedInfos", "ContractNo", "dbo.Ls_LegalContracts"); DropForeignKey("dbo.Ls_LegalContracts", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalContracts", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalContracts", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalContracts", "CaseNo", "dbo.Ls_LegalCases"); DropForeignKey("dbo.Ls_LawyerRelatedInfos", "CaseNo", "dbo.Ls_LegalCases"); DropForeignKey("dbo.Ls_LegalCases", "ServiceType", "dbo.Base_LegalServiceTypes"); DropForeignKey("dbo.Ls_LegalCases", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalCases", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalCases", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LegalCases", "CompanyNo", "dbo.Cs_ClientCompanies"); DropForeignKey("dbo.Ls_Lawyers", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_Lawyers", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_Lawyers", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LawFirms", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LawFirms", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Ls_LawFirms", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Cs_ClientStaffs", "OrganizationNo", "dbo.Cs_ClientOrganizations"); DropForeignKey("dbo.Cs_ClientStaffs", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Cs_ClientStaffs", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Cs_ClientStaffs", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Cs_ClientStaffs", "CompanyNo", "dbo.Cs_ClientCompanies"); DropForeignKey("dbo.Cs_ClientOrganizations", "ParentNo", "dbo.Cs_ClientOrganizations"); DropForeignKey("dbo.Cs_ClientOrganizations", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Cs_ClientOrganizations", "CompanyNo", "dbo.Cs_ClientCompanies"); DropForeignKey("dbo.Cs_ClientCompanies", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Cs_ClientCompanies", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Cs_ClientCompanies", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Settings", "UserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_UserRoles", "UserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_UserLogins", "UserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Users", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Users", "DeleterUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_Users", "CreatorUserId", "dbo.Sys_Users"); DropForeignKey("dbo.Sys_UserClaims", "UserId", "dbo.Sys_Users"); DropIndex("dbo.Sys_NotificationUsers", new[] { "UserId", "State", "CreationTime" }); DropIndex("dbo.Sys_NotificationUsers", new[] { "TenantId" }); DropIndex("dbo.Sys_UserLoginAttempts", new[] { "TenancyName", "UserNameOrEmailAddress", "Result" }); DropIndex("dbo.Sys_UserLoginAttempts", new[] { "UserId", "TenantId" }); DropIndex("dbo.Sys_UserLoginAttempts", new[] { "TenantId" }); DropIndex("dbo.Sys_UserAccounts", new[] { "IsDeleted" }); DropIndex("dbo.Sys_Tenants", new[] { "CreatorUserId" }); DropIndex("dbo.Sys_Tenants", new[] { "LastModifierUserId" }); DropIndex("dbo.Sys_Tenants", new[] { "DeleterUserId" }); DropIndex("dbo.Sys_Tenants", new[] { "IsDeleted" }); DropIndex("dbo.Sys_NotificationTenants", new[] { "TenantId" }); DropIndex("dbo.Sys_States", new[] { "CreatorUserId" }); DropIndex("dbo.Sys_States", new[] { "LastModifierUserId" }); DropIndex("dbo.Sys_States", new[] { "DeleterUserId" }); DropIndex("dbo.Sys_States", new[] { "IsDeleted" }); DropIndex("dbo.Sys_QueryInfos", new[] { "NameKey" }); DropIndex("dbo.Sys_QueryInfos", new[] { "ValueKey" }); DropIndex("dbo.Sys_QueryInfos", new[] { "ColumnKey" }); DropIndex("dbo.Sys_QueryInfos", new[] { "TableKey" }); DropIndex("dbo.Sys_AuditLogs", new[] { "UserId" }); DropIndex("dbo.Sys_AuditLogs", new[] { "TenantId" }); DropIndex("dbo.Sys_SysHelps", new[] { "CreatorUserId" }); DropIndex("dbo.Sys_SysHelps", new[] { "LastModifierUserId" }); DropIndex("dbo.Sys_SysHelps", new[] { "DeleterUserId" }); DropIndex("dbo.Sys_SysHelps", new[] { "IsDeleted" }); DropIndex("dbo.Sys_Functions", new[] { "CreatorUserId" }); DropIndex("dbo.Sys_Functions", new[] { "LastModifierUserId" }); DropIndex("dbo.Sys_Functions", new[] { "DeleterUserId" }); DropIndex("dbo.Sys_Functions", new[] { "IsDeleted" }); DropIndex("dbo.Sys_Functions", new[] { "PermissionName" }); DropIndex("dbo.Sys_Functions", new[] { "FunctionNo" }); DropIndex("dbo.Sys_AttachFiles", new[] { "CreatorUserId" }); DropIndex("dbo.Sys_AttachFiles", new[] { "TenantId" }); DropIndex("dbo.Sys_AppGuids", new[] { "IdType" }); DropIndex("dbo.Cs_StaffRelateInfos", new[] { "CreatorUserId" }); DropIndex("dbo.Cs_StaffRelateInfos", new[] { "ContractNo" }); DropIndex("dbo.Cs_StaffRelateInfos", new[] { "CaseNo" }); DropIndex("dbo.Cs_StaffRelateInfos", new[] { "CompanyNo" }); DropIndex("dbo.Cs_StaffRelateInfos", new[] { "StaffNo" }); DropIndex("dbo.Sys_RoleClaims", new[] { "RoleId" }); DropIndex("dbo.Sys_RoleClaims", new[] { "TenantId" }); DropIndex("dbo.Sys_Roles", new[] { "CreatorUserId" }); DropIndex("dbo.Sys_Roles", new[] { "LastModifierUserId" }); DropIndex("dbo.Sys_Roles", new[] { "DeleterUserId" }); DropIndex("dbo.Sys_Roles", new[] { "IsDeleted" }); DropIndex("dbo.Sys_Roles", new[] { "AccountType" }); DropIndex("dbo.Sys_Roles", new[] { "RoleType" }); DropIndex("dbo.Sys_Roles", new[] { "Name" }); DropIndex("dbo.Sys_Roles", new[] { "TenantId" }); DropIndex("dbo.Sys_NotificationSubscriptions", new[] { "NotificationName", "EntityTypeName", "EntityId", "UserId" }); DropIndex("dbo.Sys_NotificationSubscriptions", new[] { "TenantId" }); DropIndex("dbo.Ls_LegalCaseNotes", new[] { "CreatorUserId" }); DropIndex("dbo.Ls_LegalCaseNotes", new[] { "CaseNo" }); DropIndex("dbo.Ls_LegalContractSupplements", new[] { "CreatorUserId" }); DropIndex("dbo.Ls_LegalContractSupplements", new[] { "ContractNo" }); DropIndex("dbo.Ls_LegalContractNotes", new[] { "CreatorUserId" }); DropIndex("dbo.Ls_LegalContractNotes", new[] { "KeyPointNo" }); DropIndex("dbo.Ls_LegalContractNotes", new[] { "ContractNo" }); DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "CreatorUserId" }); DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "LastModifierUserId" }); DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "ContractNo" }); DropIndex("dbo.Ls_LegalContractKeyPoints", new[] { "ParentNo" }); DropIndex("dbo.Ls_LegalContractContents", new[] { "CreatorUserId" }); DropIndex("dbo.Ls_LegalContracts", new[] { "CreatorUserId" }); DropIndex("dbo.Ls_LegalContracts", new[] { "LastModifierUserId" }); DropIndex("dbo.Ls_LegalContracts", new[] { "DeleterUserId" }); DropIndex("dbo.Ls_LegalContracts", new[] { "IsDeleted" }); DropIndex("dbo.Ls_LegalContracts", new[] { "CaseNo" }); DropIndex("dbo.Ls_LegalCases", new[] { "CreatorUserId" }); DropIndex("dbo.Ls_LegalCases", new[] { "LastModifierUserId" }); DropIndex("dbo.Ls_LegalCases", new[] { "DeleterUserId" }); DropIndex("dbo.Ls_LegalCases", new[] { "IsDeleted" }); DropIndex("dbo.Ls_LegalCases", new[] { "CompanyNo" }); DropIndex("dbo.Ls_LegalCases", new[] { "ServiceType" }); DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "CreatorUserId" }); DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "ContractNo" }); DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "CaseNo" }); DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "LawFirmNo" }); DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "MasterType" }); DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "RelatedType" }); DropIndex("dbo.Ls_LawyerRelatedInfos", new[] { "LawyerNo" }); DropIndex("dbo.Ls_Lawyers", new[] { "CreatorUserId" }); DropIndex("dbo.Ls_Lawyers", new[] { "LastModifierUserId" }); DropIndex("dbo.Ls_Lawyers", new[] { "DeleterUserId" }); DropIndex("dbo.Ls_Lawyers", new[] { "IsDeleted" }); DropIndex("dbo.Ls_LawFirms", new[] { "CreatorUserId" }); DropIndex("dbo.Ls_LawFirms", new[] { "LastModifierUserId" }); DropIndex("dbo.Ls_LawFirms", new[] { "DeleterUserId" }); DropIndex("dbo.Ls_LawFirms", new[] { "IsDeleted" }); DropIndex("dbo.Sys_Permissions", new[] { "TenantId" }); DropIndex("dbo.Cs_ClientStaffs", new[] { "CreatorUserId" }); DropIndex("dbo.Cs_ClientStaffs", new[] { "LastModifierUserId" }); DropIndex("dbo.Cs_ClientStaffs", new[] { "DeleterUserId" }); DropIndex("dbo.Cs_ClientStaffs", new[] { "IsDeleted" }); DropIndex("dbo.Cs_ClientStaffs", new[] { "OrganizationNo" }); DropIndex("dbo.Cs_ClientStaffs", new[] { "CompanyNo" }); DropIndex("dbo.Cs_ClientOrganizations", new[] { "CreatorUserId" }); DropIndex("dbo.Cs_ClientOrganizations", new[] { "CompanyNo" }); DropIndex("dbo.Cs_ClientOrganizations", new[] { "ParentNo" }); DropIndex("dbo.Sys_Settings", new[] { "TenantId", "Name", "UserId" }); DropIndex("dbo.Sys_UserRoles", new[] { "UserId" }); DropIndex("dbo.Sys_UserRoles", new[] { "TenantId" }); DropIndex("dbo.Sys_UserLogins", new[] { "UserId" }); DropIndex("dbo.Sys_UserLogins", new[] { "TenantId" }); DropIndex("dbo.Sys_UserClaims", new[] { "UserId" }); DropIndex("dbo.Sys_UserClaims", new[] { "TenantId" }); DropIndex("dbo.Sys_Users", new[] { "CreatorUserId" }); DropIndex("dbo.Sys_Users", new[] { "LastModifierUserId" }); DropIndex("dbo.Sys_Users", new[] { "DeleterUserId" }); DropIndex("dbo.Sys_Users", new[] { "IsDeleted" }); DropIndex("dbo.Sys_Users", new[] { "PhoneNumber" }); DropIndex("dbo.Sys_Users", new[] { "EmailAddress" }); DropIndex("dbo.Sys_Users", new[] { "TenantId" }); DropIndex("dbo.Sys_Users", new[] { "AccountType" }); DropIndex("dbo.Sys_Users", new[] { "UserType" }); DropIndex("dbo.Sys_Users", new[] { "UserName" }); DropIndex("dbo.Cs_ClientCompanies", new[] { "CreatorUserId" }); DropIndex("dbo.Cs_ClientCompanies", new[] { "LastModifierUserId" }); DropIndex("dbo.Cs_ClientCompanies", new[] { "DeleterUserId" }); DropIndex("dbo.Cs_ClientCompanies", new[] { "IsDeleted" }); DropTable("dbo.Sys_NotificationUsers", removedAnnotations: new Dictionary { { "DynamicFilter_UserNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_UserLoginAttempts", removedAnnotations: new Dictionary { { "DynamicFilter_UserLoginAttempt_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_UserAccounts", removedAnnotations: new Dictionary { { "DynamicFilter_UserAccount_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_Tenants", removedAnnotations: new Dictionary { { "DynamicFilter_Tenant_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_NotificationTenants", removedAnnotations: new Dictionary { { "DynamicFilter_TenantNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_States", removedAnnotations: new Dictionary { { "DynamicFilter_SysState_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_QueryInfos"); DropTable("dbo.Sys_AuditLogs", removedAnnotations: new Dictionary { { "DynamicFilter_SysLog_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_SysHelps", removedAnnotations: new Dictionary { { "DynamicFilter_SysHelp_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_Functions", removedAnnotations: new Dictionary { { "DynamicFilter_SysFunction_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_AttachFiles", removedAnnotations: new Dictionary { { "DynamicFilter_SysAttachFile_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_AppGuids"); DropTable("dbo.Cs_StaffRelateInfos"); DropTable("dbo.Sys_RoleClaims", removedAnnotations: new Dictionary { { "DynamicFilter_RoleClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_Roles", removedAnnotations: new Dictionary { { "DynamicFilter_Role_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, { "DynamicFilter_Role_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_NotificationSubscriptions", removedAnnotations: new Dictionary { { "DynamicFilter_NotificationSubscriptionInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_Notifications"); DropTable("dbo.Ls_LegalCaseNotes"); DropTable("dbo.Ls_LegalContractSupplements"); DropTable("dbo.Ls_LegalContractNotes"); DropTable("dbo.Ls_LegalContractKeyPoints"); DropTable("dbo.Ls_LegalContractContents"); DropTable("dbo.Ls_LegalContracts", removedAnnotations: new Dictionary { { "DynamicFilter_LegalContractInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Base_LegalServiceTypes"); DropTable("dbo.Ls_LegalCases", removedAnnotations: new Dictionary { { "DynamicFilter_LegalCaseInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Ls_LawyerRelatedInfos"); DropTable("dbo.Ls_Lawyers", removedAnnotations: new Dictionary { { "DynamicFilter_LawyerInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Ls_LawFirms", removedAnnotations: new Dictionary { { "DynamicFilter_LawFirmInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_Permissions", removedAnnotations: new Dictionary { { "DynamicFilter_DataPermission_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, { "DynamicFilter_PermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, { "DynamicFilter_RolePermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, { "DynamicFilter_UserPermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Cs_ClientStaffs", removedAnnotations: new Dictionary { { "DynamicFilter_ClientStaffInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Cs_ClientOrganizations"); DropTable("dbo.Sys_Settings", removedAnnotations: new Dictionary { { "DynamicFilter_SysSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_UserRoles", removedAnnotations: new Dictionary { { "DynamicFilter_UserRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_UserLogins", removedAnnotations: new Dictionary { { "DynamicFilter_UserLogin_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_UserClaims", removedAnnotations: new Dictionary { { "DynamicFilter_UserClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Sys_Users", removedAnnotations: new Dictionary { { "DynamicFilter_User_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, { "DynamicFilter_User_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); DropTable("dbo.Cs_ClientCompanies", removedAnnotations: new Dictionary { { "DynamicFilter_ClientCompanyInfo_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }); } } }