Skip to content

Instantly share code, notes, and snippets.

@Version2beta
Created March 13, 2014 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Version2beta/9533942 to your computer and use it in GitHub Desktop.
Save Version2beta/9533942 to your computer and use it in GitHub Desktop.
Sequel issue
Sequel.migration do
change do
create_table :reports do
primary_key :id
column :name, String, null: false
column :product, String, null: false
column :category, String
column :topics, 'varchar[]'
column :expired_at, Time
column :updated_at, Time, null: false
column :created_at, Time, null: false
foreign_key :question_id, :questions, null: false
index :question_id
end
end
end
[12] pry(main)> a = Report.new({name: 'n', product: 'p', question_id: '123'})
=> #<Report @values={:name=>"n", :product=>"p", :question_id=>123, :topics=>[]}>
[13] pry(main)> a.valid?
E,2014-03-13 12:24:35: PG::UndefinedFunction: ERROR: operator does not exist: character varying[] = text[]
LINE 1: ..."name" = 'n') AND ("product" = 'p') AND ("topics" = ARRAY[]:...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.: SELECT count(*) AS "count" FROM "reports" WHERE (("name" = 'n') AND ("product" = 'p') AND ("topics" = ARRAY[]::text[])) LIMIT 1
Sequel::DatabaseError: PG::UndefinedFunction: ERROR: operator does not exist: character varying[] = text[]
LINE 1: ..."name" = 'n') AND ("product" = 'p') AND ("topics" = ARRAY[]:...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
from /Users/rmartin/Development/peer60/reaction/vendor/bundle/gems/sequel-4.1.1/lib/sequel/adapters/postgres.rb:161:in `exec'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment