Defining entity classes and Context classes
Enter the following command in the package Manager Console
1, Enable-migrations
Enables the data migration feature, which typically generates a migrations folder under the project root directory, which typically has two files in the folder
201408020650593_initialcreate.cs-the data structure before migration, the first half is timestamp
Configuration.cs--related configuration, whether automatic migration is required, etc., default to False
2, Add-migration
Increase the migration point, you will be asked to enter the migration point name after entering this command, which generates the following files in the Migrations folder
201408020650593_[name].cs--[name] is the name of the migration point you entered
3, Update-database-targetmigration: "201408041342375_003"
Upgrade/rollback to Migration point "201408041342375_003"
4, Update-database
Databases are upgraded to the latest schema based on entity and context definitions
5, Update-database-script
Show updated SQL statement definitions, show only, do not perform updates