Database Structure Changes#
After modifying the database entities, the following steps need to be taken to update the changed content in the database:
- Right-click on the
*.Web
project in Visual Studio, select "Set as StartUp Project," which means using the database connection string in this project. - Open the console in the directory of the
*.EntityFrameworkCore
project and execute the following command to generate a database migration file:dotnet ef migrations add Created_Book_Entity
- Run the
*.DbMigrator
project to apply the migration file. Alternatively, execute the following command in the same console to only apply the contents of the migration file to the database:dotnet ef database update
Seed Data Changes#
- Modify the content of
*.Domain\DataSender\*DataSeederContributor
to change the seed data:public class IDCloudDataSeedContributor : IDataSeedContributor, ITransientDependency {}
- Run the
*.DbMigrator
project to migrate the database schema and generate seed data in development and production environments.
Admin Login Password Changes#
Open XXW.XXX.Domain/Data/XXDbMigrationService.cs
, find the SeedDataAsync
function, where you can modify the login password for the default admin account:
await _dataSeeder.SeedAsync(new DataSeedContext(tenant?.Id)
.WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, IdentityDataSeedContributor.AdminEmailDefaultValue)
.WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, "Set the default password for the admin account initialization here")//IdentityDataSeedContributor.AdminPasswordDefaultValue
);