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

foreign key change of type don't get noticed #570

Closed
n-epifanov opened this issue Aug 2, 2018 · 7 comments · Fixed by #678
Closed

foreign key change of type don't get noticed #570

n-epifanov opened this issue Aug 2, 2018 · 7 comments · Fixed by #678

Comments

@n-epifanov
Copy link

Commands

When I change foreign key type from :restrict to :cascade or back
in e.g. Rails migration:

      remove_foreign_key :imports, :clients
      add_foreign_key :imports, :clients, on_delete: :cascade

then run
bundle exec annotate
I get
Model files unchanged.
And it's at outdated

# Foreign Keys
#
#  fk_rails_...  (client_id => clients.id) ON DELETE => restrict

Only running with --force updates them properly.

Version

  • annotate v2.7.4
  • Rails 5.2.0
  • ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
@ctran
Copy link
Owner

ctran commented Feb 14, 2019

Is it possible to give me a complete model to reproduce this? Even better if you can update one of the existing test cases.

@ctran ctran added the reviewed label Feb 14, 2019
@n-epifanov
Copy link
Author

Ok, I'll try to add a test for this.

@n-epifanov
Copy link
Author

Done.

@drwl
Copy link
Collaborator

drwl commented Apr 28, 2019

@NickTime So the test added in #601 highlights a bug that needs to be addressed?

@n-epifanov
Copy link
Author

@drwl That's right.

@drwl drwl added the bug label Apr 29, 2019
@drwl
Copy link
Collaborator

drwl commented Apr 29, 2019

Thanks for adding the test. I've marked this as a bug and will wait off on merging the test until there's an appropriate fix, as otherwise it'll fail builds going forward.

@n-epifanov
Copy link
Author

Sure, you're welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants