User Tools

Site Tools


sis_developer_manual

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sis_developer_manual [2024/03/11 01:52] – [Packaging the Frontend] ghacheysis_developer_manual [2024/12/09 08:45] (current) – [Database Upgrades] ghachey
Line 139: Line 139:
 ==== Database Upgrades ==== ==== Database Upgrades ====
  
-Database upgrades are done using the .NET EntityFrameworkCore migrations. When a new migration is made available typically in the source code you'll need to apply the migration. This can be done in a number of ways depending on preference and environment (development vs production). One way is to open the Package Manager Console within Visual Studio and run something like the following. +Database upgrades are done using the .NET EntityFrameworkCore migrations. When a new migration is made available typically in the source code you'll need to apply the migration. In production this will usually happen automatically when accessing the application after the successful upgradeIn development, I usually enable (i.e. uncomment) the commented lines below in the file **opensis.data/Models/CRMContextMySQL.cs** and configure it to run the upgrade on the desired tenant (i.e. database).
- +
-<code> +
-PM> Update-Database -Project opensis.data -Context CRMContextMySQL +
-Build started... +
-Build succeeded. +
-Applying migration '20230216092200_AlterStaffSchoolInfoMembershipId'+
-Done. +
-</code> +
- +
-A developer also suggested another by "hitting the API from postman or swagger" the URL https://localhost:port/{databaseName}/Common/getAllLanguageForLogin (replace the {databaseName} with the local databaseName) to automatically trigger the migration.  +
- +
-<note important>At the time of this writing I had to enabled (uncomment) the commented lines below in the file **opensis.data/Models/CRMContextMySQL.cs** to run the upgrade.+
  
 <code csharp> <code csharp>
Line 184: Line 172:
 </code> </code>
  
-</note>+With the above configured the upgrade will run automatically by loading the application. Another way is to open the Package Manager Console within Visual Studio and run something like the following. 
 + 
 +<code> 
 +PM> Update-Database -Project opensis.data -Context CRMContextMySQL 
 +Build started... 
 +Build succeeded. 
 +Applying migration '20230216092200_AlterStaffSchoolInfoMembershipId'
 +Done. 
 +</code> 
 + 
 +A developer also suggested another by "hitting the API from postman or swagger" the URL https://localhost:port/{databaseName}/Common/getAllLanguageForLogin (replace the {databaseName} with the local databaseName) to automatically trigger the migration. 
  
 ==== Building and Running Backend ==== ==== Building and Running Backend ====
sis_developer_manual.1710121962.txt.gz · Last modified: 2024/03/11 01:52 by ghachey