forked from kernelci/kernelci-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api.db: decouple model indexes from DB engine
Implement a dataclass `Index` to store model field names and constraints to create indexes. Instead of directly creating indexes from model method for specific DB engine (at the moment, MongoDB), implement a method to get indexes from models independent of DB engine i.e. list of `DatabaseModel.Index` class instances. Create MongoDB specific indexes in the database method `Database.create_indexes`. Signed-off-by: Jeny Sadadia <[email protected]>
- Loading branch information
1 parent
49ebedf
commit 4f69b70
Showing
2 changed files
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters