-
Notifications
You must be signed in to change notification settings - Fork 226
Migrations
Simon Hughes edited this page Aug 23, 2020
·
6 revisions
This assumes your dba's are relinquishing control of the database schema over to using migrations.
- In your generator
<database>.ttsetting file, setSettings.GenerateSeparateFiles = true;and press save to reverse engineer the database. - Enable migrations using the package management console using the command
enable-migrations - Add your first migration using the command
Add-Migration Init -IgnoreChanges-IgnoreChanges Scaffolds an empty migration ignoring any pending changes detected in the current model. This can be used to create an initial, empty migration to enable Migrations for an existing database. Note: Doing this assumes that the target database schema is compatible with the current model, which is exactly what you now have.
- Delete the
<database>.ttsetting file and theEF.Reverse.POCO.v3.ttincludefile as you will no longer need them. - Inform the dba's that the database schema is now managed by migrations from now on.
- Home
- Compared with the Microsoft scaffolder
- Connection strings
- JetBrains Rider
- Upgrading from v3 to v4
- Saving .tt does nothing
- Settings A-Z - every setting, with a page each
- Common Settings Types Explained
- Settings Callbacks
- Settings runtime values and helpers
- Filtering
- Full Control Over the Generated Code
- Enum Generation from Table Data
- Owned Entities
- JSON column support
- Global Query Filters
- Extended Property Names Feature
- Partial Properties
- File-Scoped Namespaces
- Data Annotations
- Spatial Types
- HierarchyId
- RowVersion and TimeStamp columns
- Lazy Loading
- Stored proc result sets