protected override void execute() { //V2版本允许多通道,激活标记放入SendAuthInfo表中,增加Active列,同时更新原有用户的激活通道 Migrator.AlterTable <SendAuthInfo>().AddColumn(e => e.Active).Execute(); Migrator.AlterTable <SendAuthInfo>().AddColumn(e => e.Key).Execute(); Migrator.Database.UpdateMany <SendAuthInfo>().OnlyFields(e => e.Active).Execute(new SendAuthInfo() { Active = false }); var activeUsers = Migrator.Database.Query <SendUserInfo>().ToList(); activeUsers.ForEach(user => { var sendUserInfo = Migrator.Database.Query <SendAuthInfo>().FirstOrDefault(e => e.Id == user.SendAuthId); if (sendUserInfo != null) { sendUserInfo.Active = true; Migrator.Database.Update(sendUserInfo, e => e.Active); } }); }