Comments (9)
oops sorry for the delay, managed to not see the notification for this. are you still experiencing this problem?
from schema_plus.
I am also seeing this issue.
from schema_plus.
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.
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.
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.
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.
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.
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.
this should be fixed in master & next release.
from schema_plus.
Related Issues (20)
- Thread safety problem with schema_plus 2 / Postgres HOT 8
- Wrong index export in jsonb column HOT 2
- change_column uses default foreign key configuration instead of defined configuration causing migration to crash HOT 1
- schema_plus 1.8.x: jruby + postgresql with activerecord-jdbcpostgresql-adpater > 1.3.14 HOT 2
- When using add_column foreign key does not use the default_name method HOT 3
- Schema dump support for multiple schemas HOT 6
- doesn't work with annotate gem and MySQL and postgres
- Index name not respected when adding an index in `change_table` HOT 2
- Schema plus schema dump crashes on custom types on postgresql HOT 5
- Bug: Postgres expression index with multiple expressions runs correct SQL, but produces incorrect schema modifications HOT 2
- add_foreign_key not compatible with Activerecord version HOT 1
- All but the last `t.index` reference for a table are ignored HOT 4
- Wrong foreign_key format in schema.rb HOT 5
- Support Rails 5 HOT 9
- Issue when upgrading from Rails 4.2.5.2 to 4.2.6 HOT 5
- Upgrade from 2.0.0 to 2.0.1 alters schema.db file format HOT 8
- New gem request: Support arbitrary per-table and/or per-column metadata in schema
- Guidance with parsing CREATE sql for Sql Server HOT 3
- Support ruby +2.1 HOT 2
- nal has_many
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from schema_plus.