This project is archived and is in readonly mode.
Postgresql tsvector datatype not recognized in schema.rb
-
Robert Sosinski
Attaching updated patch. PostgreSQLColumn#simplified_type should probably specify tsvector as a :tsvector, not a :string.
-
Robert Sosinski
Some more info about this. So, ActiveRecord seems to cast tsvector to a String when read from a record. ALso, if migrations define tsvectors as type tsvector in schema.rb, rails errors out during rake db:test:prepare. Interested if the migration should then just define a tevector as a String in schema.rb then?
Interested in hearing any ideas.
Thanks.
-
rails
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
rails
- State changed from open to stale
-
Gavin Brock
Added a pull request against 3-0-stable: https://github.com/rails/rails/pull/197
-
Scott Lowe
- Assigned user set to Aaron Patterson
I've written some simple tests to support the PostgreSQL tsvector data type patch for #6073 Postgresql tsvector datatype not recognized in schema.rb.
Writing these tests has raised some questions. Whilst we can now schema dump without fear, is the data type useful on it's own? I can't think of a case where I would use the tsvector type without a trigger and of course that is not something that is presently supported in the schema DSL (or perhaps I've missed something?).
I've attached a patch which includes Robert Sosinski's patch and my tests.
-
Scott Lowe
- Assigned user cleared.
