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

Exclude deleted items from queries. #7

Merged
merged 2 commits into from
Sep 11, 2018
Merged

Conversation

jsuchome
Copy link
Contributor

@jsuchome jsuchome commented Sep 10, 2018

  • excluding deleted items should make the migration faster
  • it is even necessary when user deletes the items that do not pass the precheck (like wrong UTF chars)

Copy link
Contributor

@rhafer rhafer left a comment

Choose a reason for hiding this comment

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

Nice! Could we please add a command line argument for this feature? Some setups might want to keep the deleted records (e.g. for audit reasons)

psql2mysql.py Outdated
def _exclude_deleted(self, table, query):
if not "deleted" in table.columns:
return query
if isinstance(table.columns["deleted"].type, types.INTEGER):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is does this really work? It seems that e.g. manila is using "varchar" for some if the "deleted" columns for whatever reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was already surprised that there's a Int type of 'deleted' and you're saying there could be more?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, manila tables really have them all, deleted as Boolean, Integer and String :-)

@rhafer rhafer merged commit 0273423 into SUSE:master Sep 11, 2018
@jsuchome jsuchome deleted the ignore-deleted branch September 11, 2018 08:51
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.

None yet

2 participants