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: MySQL table support comment #10017

Merged
merged 23 commits into from
Jan 3, 2024

Conversation

sinkhaha
Copy link
Contributor

@sinkhaha sinkhaha commented May 4, 2023

Description of change

MySQL table support comment
Fixes #9991

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run format to apply prettier formatting
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

@pleerock
Copy link
Member

pleerock commented May 9, 2023

Why do you have package-lock file changed?

There is a problem with your implementation - sync doesn't work such way. If you put comment to entity - it will be stored in the database. If you change comment on the same entity later on - it won't sync the changes.

We need implementation to be full-fledged before we can merge the changes.

@sinkhaha sinkhaha force-pushed the mysql_table_comment_support branch from 774084e to 33512d2 Compare May 15, 2023 08:20
@sinkhaha
Copy link
Contributor Author

sinkhaha commented May 15, 2023

Why do you have package-lock file changed?

There is a problem with your implementation - sync doesn't work such way. If you put comment to entity - it will be stored in the database. If you change comment on the same entity later on - it won't sync the changes.

We need implementation to be full-fledged before we can merge the changes.

Thanks, this is an oversight on my part, I'm not familiar with the sync, can you give me some guidance? Is it okay to modify the renameTable method of the MysqlQueryRunner class or add a new method to modify table comments separately

@sinkhaha sinkhaha closed this May 15, 2023
@sinkhaha sinkhaha reopened this May 15, 2023
@pleerock
Copy link
Member

@sinkhaha let's say you put comment to entity. Comment now is in database for your table. Now change comment in the entity. Syncer must "catch up" this change and update the table comment in the database.

Synchronization is made by dataSource.synchronize() method.

To understand how it works, play around with let's say columns -> add column, remove column from your entity -> database table will be updated.

To understand how it works from the code perspective - you have to learn how QueryRunner (mysql one in your case) work.

@sinkhaha
Copy link
Contributor Author

sinkhaha commented May 17, 2023

@pleerock Thanks. I have made some changes. Please review it again when you have time.

@yuntian001
Copy link

ci/circleci: build — Your tests failed on CircleCI

Whether you have time to fix

@sinkhaha
Copy link
Contributor Author

@yuntian001 This doesn't seem to be an error caused by my changes. Is it okay to rebuild it? I don't have permission to trigger.

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.

Create table comment
5 participants