[Reputation Oracle] refactor: typeorm usage #3154
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue tracking
Part of #3084
Context behind the change
Tip
Easier to review commit-by-commit
This work is a prerequisite for moving on with modules refactoring that depend on typeorm.
Main change is to use "Data Mapper" approach instead of "Active Record" (typeorm ref) so we don't have to care about
OrmBaseEntity
methods being exposed out of repository. In follow-up PRs for each separate module we will work on better typings and improving approach on service-repository-datamodel usage.Also cleaned up
DataSource
configurations to be meaningful and use only valid options.Warning
We have two different DataSource configs: one for application, one for migrations. Because of that we keep using database schema name in each
@Entity
decoratorHow has this been tested?
created_at
andupdated_at
are added to token entityno pending migrations
yarn migration:generate testMigrationName
and verify that migration generated properlyRelease plan
Simply merge
Potential risks; What to monitor; Rollback plan
Should be none