Code Monkey home page Code Monkey logo

Comments (5)

ankane avatar ankane commented on June 25, 2024 1

Going to close this out, but feel free to create a PR

from strong_migrations.

ankane avatar ankane commented on June 25, 2024

Hey @iamvery, thanks for the suggestion. I think this is best as a custom check. I imagine most of the time foreign keys need to be valid.

from strong_migrations.

iamvery avatar iamvery commented on June 25, 2024

Thanks for the response @ankane! I'm a little indifferent on this, but I understand your point. I'm indifferent, because I feel like if the purpose of this library is to protect users from themselves it might go so far to recommend against typical cases like this in the name of safety.

Strong Migrations detects potentially dangerous operations in migrations, prevents them from running by default, and provides instructions on safer ways to do what you want.

Either way, the custom checks are a great feature that we can take advantage of. Thank you!

from strong_migrations.

ankane avatar ankane commented on June 25, 2024

Reading about the issue more, agree that it'd be good for the gem to handle it, so happy to accept a PR. Since the validate option was introduced in Rails 5.2, the instructions will probably need to use execute in previous versions. There will need to be instructions for validating as well.

References:

from strong_migrations.

iamvery avatar iamvery commented on June 25, 2024

Thanks for the follow up here! It's going to be a few days before I can dig in, but this sounds great 👍

from strong_migrations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.