Closed philanderson888 closed 4 years ago
Log into Azure Find the database App is MVCFamilyApp2019102003 Resource Group is MVCFamilyApp201910 Database is FamilyDatabase04
Find Query Editor Table is DailyLogs Add field SQL alter command alter table [dbo].[DailyLogs] add NbrGrps int null
Firstly the model
Existing model is as such
public class DailyLog
{
public int DailyLogId { get; set; }
[Display(Name = "Date")]
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
public DateTime LogDate { get; set; }
public String Comments { get; set; }
public bool UpOnTime { get; set; }
public bool StayedUp { get; set; }
public bool MadeGym { get; set; }
public bool PrWthFam { get; set; }
public bool PrWthZ { get; set; }
public bool CrsPryPhoto { get; set; }
public bool PhilPryPhoto { get; set; }
public bool CrsDeskPhoto { get; set; }
public int NbrSns { get; set; }
}
New class is
public class DailyLog
{
public int DailyLogId { get; set; }
[Display(Name = "Date")]
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
public DateTime LogDate { get; set; }
public String Comments { get; set; }
public bool UpOnTime { get; set; }
public bool StayedUp { get; set; }
public bool MadeGym { get; set; }
public bool PrWthFam { get; set; }
public bool PrWthZ { get; set; }
public bool CrsPryPhoto { get; set; }
public bool PhilPryPhoto { get; set; }
public bool CrsDeskPhoto { get; set; }
public int NbrSns { get; set; }
public int NbrGrps { get; set; }
public bool GymCardio { get; set; }
public bool GymWeights { get; set; }
public bool GymSprints { get; set; }
public bool GymChest { get; set; }
public bool GymBack { get; set; }
public bool GymLegs { get; set; }
public bool GymBicep { get; set; }
public bool GymTricep { get; set; }
public bool GymShoulders { get; set; }
public bool GymClass { get; set; }
public bool GymDips { get; set; }
public bool GymPullUps { get; set; }
public bool GymPushUps { get; set; }
}
This incorporates changes from issue 22 also which is adding in gym fields ie
I've manually updated all of the views - Index, Edit, Create, Delete, Details
let's see if the application still works!
Let's take a risk and publish the application live and see if it works or not.
Chances are slim but I've only made some trivial changes so there might be a chance it just works out of the box!
No - it does not work so I'm going to have to do some more work! I could put it into development mode in Azure or I could update the local database. Let's try Azure! Put app into development mode
portal.azure.com find the app service click on Configuration add new setting ASPNETCORE_ENVIRONMENT = Development
After now updating the controller and the individual views, this item is now closed!
Update the database for my family management system to include a new field
Update field on azure
Update controller
Update view