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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atlas integration to support disabled foreign keys #2288

Closed
naormatania opened this issue Jan 24, 2022 · 4 comments
Closed

Atlas integration to support disabled foreign keys #2288

naormatania opened this issue Jan 24, 2022 · 4 comments
Labels

Comments

@naormatania
Copy link
Contributor

Summary 馃挕

You currently cannot use Atlas integration (https://entgo.io/docs/migrate/#atlas-integration) while disabling foreign key (https://entgo.io/docs/migrate#foreign-keys)

You currently get back an error errors.New("sql/schema: WithForeignKeys(false) does not work in Atlas migration") (

return errors.New("sql/schema: WithForeignKeys(false) does not work in Atlas migration")
)

Motivation 馃敠

Atlas integration is useful for many things like validating migration diffs, #1688 and more
Disabling foreign keys is good for improving performance and also for more distributed setup where each microservice controls its own schema/database

It would be great if both could work together

@a8m
Copy link
Member

a8m commented Jan 24, 2022

Hey @naormatania and thanks for opening this issue.

I should get to this later this week. Would you like to contribute this? It should be pretty simple to implement 馃槂

@naormatania
Copy link
Contributor Author

Thanks @a8m !
I don't think I have time to contribute but I'm looking forward for this :)

@zeevmoney
Copy link
Contributor

Hi @naormatania,

I just pushed a PR that adds the feature you've been asking for in here

#2404

@a8m
Copy link
Member

a8m commented Mar 17, 2022

Thanks @naormatania and @zeevmoney

@a8m a8m closed this as completed Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants