Giter VIP home page Giter VIP logo

Comments (9)

ronen avatar ronen commented on August 13, 2024

oops sorry for the delay, managed to not see the notification for this. are you still experiencing this problem?

from schema_plus.

kjg avatar kjg commented on August 13, 2024

I am also seeing this issue.

from schema_plus.

ronen avatar ronen commented on August 13, 2024

if this is what i think it is (would need to see more detail from the log to know exactly what pg is complaining about), the workaround until it gets fixed is to precede the change_column with a remove_index, e.g.:

remove_index :mytable, :mycolumn
change_column :mytable, :mycolumn, ...

let me know if that does/doesn't work for you.

from schema_plus.

kjg avatar kjg commented on August 13, 2024

That did work for me, thanks! It even keeps/adds back the index I removed event though I don't specify the index again in my change_column.

from schema_plus.

ronen avatar ronen commented on August 13, 2024

glad that worked. and yes, i forgot to mention i'd expect that the index would come back: the bug is that change_column is auto-creating the index without first checking to see if it's already there.

from schema_plus.

kjg avatar kjg commented on August 13, 2024

Interestingly the remove_index was only needed on my up migration which was
only adding a :null => false. My down migration with :null => true works
just fine without removing the index first.

from schema_plus.

ronen avatar ronen commented on August 13, 2024

interesting... and a bit disturbing :) i'll keep it in mind when i get a chance to dig into this.

btw thanks for reporting the problem, and apologies for the inconvenience it caused you.

from schema_plus.

zephyr-dev avatar zephyr-dev commented on August 13, 2024

Also seeing this bug, and the fix you suggested worked fine. Our down migration required us do a remove_index before we did the change_column for null: true.

from schema_plus.

ronen avatar ronen commented on August 13, 2024

this should be fixed in master & next release.

from schema_plus.

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.