Covenant icon indicating copy to clipboard operation
Covenant copied to clipboard

[Feature Request] Database Migrations

Open sbrun opened this issue 3 years ago • 5 comments

Feature Request Feature Request

Describe the feature request or bug After an update from version 0.5 to version 0.6, when we start covenant, it fails with an sqlite error.

If I understand correctly, you do not update the database. We need to remove the covenant.db to "fix" this.

To Reproduce

  1. Install version 0.5 (by installing dotnet core)
  2. Run covenant at least once to create the database
  3. Update covenant to version 0.6
  4. Run covenant
  5. An exception occurred while iterating over the results of a query for context type 'Covenant.Models.CovenantContext'. Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such table: Themes'.

Expected behavior There should be no need to delete the database. I think you should handle the db upgrade.

Target Information (System that implant is running on):

  • OS: kali

sbrun avatar Apr 20 '21 16:04 sbrun

@sbrun This is expected behavior, Covenant does not include database migrations for now, the database must be reset between version upgrades. Might look into that around the v1.0 timeframe.

cobbr avatar Apr 20 '21 16:04 cobbr

Will track this as a long-term feature request.

cobbr avatar Apr 20 '21 16:04 cobbr

I thought it was the desired behavior. Thanks for the confirmation. It would be a nice feature to have.

sbrun avatar Apr 20 '21 16:04 sbrun

I've search about database migration feature for Razor and end up with this link: https://www.learnrazorpages.com/razor-pages/tutorial/bakery/migration

I hope it can help :)

aancw avatar Apr 23 '21 08:04 aancw

I'm sure EntityFrameworkCore has features for DB migration. But I'm not comfortable with the overhead this will create until we have at least reached a v1.0.

cobbr avatar May 03 '21 04:05 cobbr