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

schema comment: load column comment, pass to atlas migration #2554

Closed
wants to merge 4 commits into from

Conversation

CharlesGe129
Copy link
Contributor

Context:
We uses atlas to generate versioned migration .sql files.

Problem:
The columns' comments defined in schema are not generated to ent/migrate/schema.go. Thus, the .sql files generated by atlas doesn't contain column comments such as (name varchar(255) NOT NULL COMMENT "name of entity") in MySQL.

@CharlesGe129
Copy link
Contributor Author

ummm..., I may need your help to pass the unit tests. I think those failed tests are not related to my changes.

@a8m
Copy link
Member

a8m commented May 20, 2022

Thanks for the contribution @CharlesGe129 🙏

PR looks fine to me, but integration tests fail. Can you please try to rebase your branch on master? If it won't work, I'll pull the changes and try this.

@liasica
Copy link

liasica commented May 21, 2022

Thanks for this PR @CharlesGe129 .

@CharlesGe129
Copy link
Contributor Author

I think I just rebased and updated this PR. Could you please check again? Not sure if I followed the right process.

@CharlesGe129
Copy link
Contributor Author

@a8m Sorry to bother again. I'm unable to fix the integration tests but I think it might be unrelated to the code I changed. Could you please check what's going on and tell me how may I help to solve that? Thanks!

@CharlesGe129
Copy link
Contributor Author

Related issues: #2550 #2217 #1627 #1546

@masseelch masseelch self-assigned this Jul 4, 2022
@a8m
Copy link
Member

a8m commented Dec 26, 2022

The issue was resolved with: https://entgo.io/docs/schema-annotations#database-comments.

Update your Ent version to master, and check out this tweet to see an example: https://twitter.com/entgo_io/status/1607394587009589248

@a8m a8m closed this Dec 26, 2022
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

4 participants