Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write apps to mongo #32

Merged
merged 20 commits into from
Sep 21, 2022
Merged

Write apps to mongo #32

merged 20 commits into from
Sep 21, 2022

Conversation

rem1niscence
Copy link
Contributor

Adds a new lambda: migrate-to-mongo whose job is to perform routine migrations of apps/lbs created in the postgres database to the mongo database for data integrity while the migration is being performed

@height
Copy link

height bot commented Sep 21, 2022

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

)

type GatewayAAT struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long-term, all the models need to be updated to use portal-api-go repository package IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but for this case the point is to migrate to the mongo equivalent which is not the same

return 0, 0, err
}

appsToWrite := convertRepositoryToMongo(getItemsNotInMongo(postgresApps, mongoApps), models.RepositoryToModelApp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to compare the two lists to only add entries that are needed to Mongo (unless the intention is to consistently UPDATE and keep in exact sync with Postgres DB?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this only adds new entries once, that results an empty slice in case there is none

@rem1niscence rem1niscence merged commit 0c750b7 into master Sep 21, 2022
@rem1niscence rem1niscence deleted the write-apps-to-mongo branch September 21, 2022 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants