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

feat(structure-comapre): implement database object structure comparison #1364

Merged
merged 5 commits into from
Jan 10, 2024

Conversation

PeachThinking
Copy link
Collaborator

@PeachThinking PeachThinking commented Jan 9, 2024

What type of PR is this?

type-feature
modul-structure-compare

What this PR does / why we need it:

Implementation class of structure comparison task

  1. add DBStructureComparator interface to compare database objects between two schema according to config.
  2. add DBObjectStructureComparator<T extends DBObject> interface to compare different database object types between two schema.
  3. The table's columns, indexes, constraints, and partition object's comparison results will be sub-objects of the table DBObjectComparisonResult,refer to DBObjectComparisonResult#getSubDBObjectComparisonResult().
    For table object, DBObjectComparisonResult#getChangeScript() only only record the change script of table options.
  4. Add support alter table charset and collate code in MySQLTableEditor#generateUpdateTableOptionDDL. Oracle do not support alter table charset and collate.

Which issue(s) this PR fixes:

Fixes #816

Special notes for your reviewer:

Additional documentation e.g., usage docs, etc.:


@PeachThinking PeachThinking added the type-feature The functionality to be implemented label Jan 9, 2024
@PeachThinking PeachThinking added this to the ODC 4.2.4 milestone Jan 9, 2024
@PeachThinking PeachThinking self-assigned this Jan 9, 2024
Copy link
Collaborator

@MarkPotato777 MarkPotato777 left a comment

Choose a reason for hiding this comment

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

DBObjectStructureComparator's implementations have some duplicated code, can we reduce it? Maybe we lack some abstraction.

@PeachThinking PeachThinking changed the title feat(structure-comapre): implement OdcDBStructureComparator feat(structure-comapre): implement database object structure comparison Jan 9, 2024
@PeachThinking
Copy link
Collaborator Author

DBObjectStructureComparator's implementations have some duplicated code, can we reduce it? Maybe we lack some abstraction.

Added AbstractDBObjectStructureComparator to extract duplicate code of TableConstraintStructureComparator and TableIndexStructureComparator

Copy link
Contributor

@yhilmare yhilmare left a comment

Choose a reason for hiding this comment

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

lgtm

@yhilmare yhilmare merged commit 5ad1371 into dev/4.2.x Jan 10, 2024
11 checks passed
@yhilmare yhilmare deleted the feat/jingtian_424_support_schema_structure_sync branch January 10, 2024 02:16
yhilmare pushed a commit that referenced this pull request Jan 15, 2024
…on (#1364)

* implement OdcDBStructureComparator

* delete SchemaBrowserExtensionPoint

* response to review

* add AbstractDBObjectStructureComparator

* response to review
LuckyPickleZZ pushed a commit that referenced this pull request Jan 15, 2024
…on (#1364)

* implement OdcDBStructureComparator

* delete SchemaBrowserExtensionPoint

* response to review

* add AbstractDBObjectStructureComparator

* response to review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature The functionality to be implemented
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants