vendrcontrib / vendr-wishlists

[WIP] Wishlists for Vendr, the eCommerce solution for Umbraco v8+
MIT License
0 stars 1 forks source link

[Task] Separate the Migration from the DTO #1

Closed NikRimington closed 3 years ago

NikRimington commented 4 years ago

Migrations should, in theory, be immutable, as much as possible. Tying a migration directly to a DTO can cause issues with future migrations so we should follow one of 2 patterns.

  1. Create a dedicated Migration Model for the initial migration.
  2. Use the approached used in the Review package and manually create the table, this would make it easier to include foreign keys to other Vendr tables.
bjarnef commented 4 years ago

Yeah, the migration was copied from previous code in the reviews package, where I initial used the approach from Skybrud Redirects package https://github.com/skybrud/Skybrud.Umbraco.Redirects/tree/v2/latest/src/Skybrud.Umbraco.Redirects/Migrations

But we can use a similar approach as in Vendr Reviews package: https://github.com/vendrcontrib/vendr-reviews/tree/dev/src/Vendr.Contrib.Reviews/Migrations/V_1_0_0

bjarnef commented 3 years ago

I think this should have been resolved in https://github.com/vendrcontrib/vendr-wishlists/commit/81cdeb52790496abc46c6696045d9d413de2cd5c so I will close this one.