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

Running migration cause error #42

Closed
dmons opened this issue May 10, 2012 · 2 comments
Closed

Running migration cause error #42

dmons opened this issue May 10, 2012 · 2 comments

Comments

@dmons
Copy link

dmons commented May 10, 2012

Model Comment has code as in example:

class Comment < ActiveRecord::Base
...
 auto_html_for :comment do
    html_escape
    image
    youtube(:width => 400, :height => 250)
    link :target => "_blank", :rel => "nofollow"
    simple_format
  end
...

Migration for this model also fine.

create_table "comments", :force => true do |t|
      t.text :comment,              :default => ""
      t.text :comment_html,         :default => ""
      t.references :creator
      t.references :userpost
      t.integer :people_rate,       :default=>0, :null=>false       
      t.integer :votes_cnt,         :default=>0, :null=>false       
      t.integer :parent_id,         :default=>nil                   
      t.integer :lft                                                
      t.integer :rgt                                               
      t.integer :depth,              :default=>0                    
      t.boolean :is_public,          :default=>true, :null=>false    
      t.boolean :delta,              :default=>true                
      t.timestamps
    end
   add_index :comments, :creator_id
   add_index :comments, :userpost_id

Everything has worked, till I've updated gem. Now AR exception rised:

PG::Error: ERROR:  relation "comments" does not exist
LINE 4:              WHERE a.attrelid = '"comments"'::regclass
                                        ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"comments"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum

Renaming colomn doesn't solve issue.

@dmons
Copy link
Author

dmons commented May 30, 2012

Hey guys! Where are you? Issue appeared in 1.5.2 version and presents in 1.5.3

@dejan dejan closed this as completed in 9e4078b Jul 28, 2012
@dejan
Copy link
Owner

dejan commented Jul 29, 2012

This issue should be resolved in 1.6.0

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

No branches or pull requests

2 participants