Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

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

Open
kokizzu opened this issue Aug 22, 2013 · 2 comments

Comments

@kokizzu
Copy link

kokizzu commented Aug 22, 2013

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
Copy link

d4l3k commented Feb 27, 2014

This is still an issue.

@metahertz
Copy link

+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)

Sliim added a commit to Sliim/beef that referenced this issue Jul 7, 2016
looks to have an issue in dm-postgres-adapter:
datamapper/dm-postgres-adapter#7

Workaround: Removed Binary type for extension_requester_http
response_data property. Maybe this extension wont works properly..
But now, BeEF start!
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants