Created
March 13, 2014 18:24
-
-
Save Version2beta/9533942 to your computer and use it in GitHub Desktop.
Sequel issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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