datamapper / dm-postgres-adapter

A postgresql Adapter for DataMapper
http://datamapper.org/
MIT License
14 stars 13 forks source link

DataObjects::SyntaxError: ERROR: type modifier is not allowed for type "bytea" Edit #7

Open kokizzu opened 11 years ago

kokizzu commented 11 years ago

the record

class Testing
  include DataMapper::Resource
  property :id, DataMapper::Property::Serial
  property :email, String, unique_index: true
  property :password, Binary, length: 64 # for SHA-512
end
DataMapper.finalize
DataMapper.auto_migrate!

the error message

 ~ (0.000329) CREATE TABLE "testings" ("id" SERIAL NOT NULL, "email" VARCHAR(50), "password" BYTEA(64), PRIMARY KEY("id"))
 ~ ERROR:  type modifier is not allowed A (code: 16801924, sql state: 42601, query: CREATE TABLE "testings" ("id" SERIAL NOT NULL, email" VARCHAR(50), "password" BYTEA(64), PRIMARY KEY("id")), uri: postgres:ayayay@127.0.0.1/aya?scheme=postgres&user=ayayay&password=wrong_password&host=127.0.0.1&port=&path=/aya&query=&fragment=&adapter=postgres)
 ~ (0.000102) RESET client_min_messages
/home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:100:in `execute_non_query': ERROR:  type modifier is not allowed A (DataObjects::SyntaxError)

the version

$ psql --version
psql (PostgreSQL) 9.2.4
$ gem list | grep data_mapper
data_mapper (1.2.0)
$ ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]
$ jruby --version
jruby 1.7.4 (2.0.0) 2013-05-16 2390d3b on OpenJDK Server VM 1.7.0_40-b31 +indy [linux-i386]
$ uname -a
Linux unusual 3.10.5-1-pae #1 SMP PREEMPT Tue Aug 6 18:31:23 EDT 2013 i686 GNU/Linux

the stack trace:

        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:100:in `block (2 levels) in create_model_storage'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:98:in `each'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:98:in `block in create_model_storage'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:276:in `with_connection'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:93:in `create_model_storage'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-postgres-adapter.rb:23:in `block in create_model_storage'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-postgres-adapter.rb:58:in `without_notices'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-postgres-adapter.rb:23:in `create_model_storage'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:81:in `create_model_storage'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:177:in `auto_migrate_up!'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:132:in `auto_migrate!'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:47:in `block in repository_execute'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-core-1.2.1/lib/dm-core/support/descendant_set.rb:64:in `block in each'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-core-1.2.1/lib/dm-core/support/subject_set.rb:211:in `block in each'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-core-1.2.1/lib/dm-core/support/ordered_set.rb:320:in `block in each'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-core-1.2.1/lib/dm-core/support/ordered_set.rb:320:in `each'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-core-1.2.1/lib/dm-core/support/ordered_set.rb:320:in `each'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-core-1.2.1/lib/dm-core/support/subject_set.rb:211:in `each'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-core-1.2.1/lib/dm-core/support/descendant_set.rb:63:in `each'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:46:in `repository_execute'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:22:in `auto_migrate!'
        from /home/asd/.gem/ruby/2.0.0/gems/dm-constraints-1.2.0/lib/data_mapper/constraints/migrations/singleton_methods.rb:10:in `auto_migrate!'
d4l3k commented 10 years ago

This is still an issue.

metahertz commented 10 years ago

+1 Still seeing this with 1.2.0

Using dm-core (1.2.1) Using dm-do-adapter (1.2.0) Using dm-migrations (1.2.0) Using do_postgres (0.10.14) Using dm-postgres-adapter (1.2.0) Using eventmachine (1.0.3) Using em-websocket (0.3.8)