#1350 new
Lee Hambley

No suitable Text type for DM-Migrations or DM-Core

Reported by Lee Hambley | July 4th, 2010 @ 05:09 AM

Ruby 1.9.1, 1.9.2-x (probably others?)
Operating System: OSX 10.6 
Datamapper:
  * data_mapper (1.0.0)
  * data_objects (0.10.2)
  * dm-aggregates (1.0.0)
  * dm-constraints (1.0.0)
  * dm-core (1.0.0)
  * dm-do-adapter (1.0.0)
  * dm-migrations (1.0.0)
  * dm-mysql-adapter (1.0.0)
  * dm-serializer (1.0.0)
  * dm-timestamps (1.0.0)
  * dm-transactions (1.0.0)
  * dm-types (1.0.0)
  * dm-validations (1.0.0)
MySQL:
  +-------------------------+---------------------+
  | Variable_name           | Value               |
  +-------------------------+---------------------+
  | protocol_version        | 10                  |
  | version                 | 5.1.48              |
  | version_comment         | Source distribution |
  | version_compile_machine | i386                |
  | version_compile_os      | apple-darwin10.3.0  |
  +-------------------------+---------------------+
migration 1, :create_registrants do
  up do
    create_table :registrants do
      column :id, Integer, :serial => true
      column :email, String, :size => 255
      column :preferred_username, String, :size => 255
      column :display_name, String, :size => 255
      column :identifier, String, :size => 255
      column :photo, String, :size => 255
      column :url, String, :size => 255
      column :raw, Text
    end
  end

  down do
    drop_table :registrants
  end
end

Causes an Anonymous modules have no name to be referenced by error, changing the text-line to read column :raw, DataMapper::Types::Text resolves this (I believe that this is covered in another ticket.)

However the output is:

 $ padrino rake dm:reset dm:setup
=> Executing Rake dm:reset dm:setup ...
=> Located locked Gemfile for development
=> Dropping database 'project_development'
<= dm:drop executed
=> Creating database 'project_development'
<= dm:create executed
 == Performing Up Migration #1: create_registrants
   CREATE TABLE `registrants` (`id` SERIAL PRIMARY KEY, `email` VARCHAR(255), `preferred_username` VARCHAR(255), `display_name` VARCHAR(255), `identifier` VARCHAR(255), `photo` VARCHAR(255), `url` VARCHAR(255), `raw` VARCHAR(65535)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
rake aborted!
Column length too big for column 'raw' (max = 21845); use BLOB or TEXT instead
/Users/leehambley/.rvm/gems/ruby-1.9.2-rc1/gems/padrino-core-0.9.13/lib/padrino-core/cli/rake.rb:9:in `init'
(See full trace by running task with --trace)

Expected output naturally is ...snip... raw TEXT) ENGINE = InnoDB ...snip.... (where raw should still have backticks, Lighthouse ate my ticks!)

I've made a few passes at refactoring this… and the irony is that this is JSON data… if there were some good documentation for DM-Types I might have been able to use that and never have to file this report!

It should be noted that using Object worked as expected… but then base64 encodes a marshalled ruby object, which is simply too much obfuscation when all I really want to store is JSON data :)

Thanks guys, I really love the paradigm you are working towards… still a few too many rough edges though!

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Pages