
Type Json fails to migrate.
Reported by ojak | June 29th, 2009 @ 02:56 AM | in 0.10.2
Json type fails migration with the following error:
~ Column length too big for column 'data' (max = 21845); use BLOB or TEXT instead (code: 1074, sql state: 42000, query: CREATE TABLE "temp_payments" ("session_id" VARCHAR(32) NOT NULL, "data" VARCHAR(65535), "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL, PRIMARY KEY("session_id")) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci, uri: mysql://root@localhostcyr_dev?socket=/tmp/mysql.sock) rake aborted! Column length too big for column 'data' (max = 21845); use BLOB or TEXT instead /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/migrations.rb:151:in
execute_non_query' /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/migrations.rb:151:increate_model_storage' /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/adapters/data_objects_adapter.rb:263:inwith_connection' /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/migrations.rb:148:in
create_model_storage' /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/migrations.rb:669:increate_model_storage' /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/migrations.rb:769:in
auto_migrate_up!' /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/migrations.rb:51:insend' /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/migrations.rb:51:in
repository_execute'
Sample model:
class Book
property :json_data, Json
end
Tried this patch, but it DID NOT WORK.
# dm-types-0.10.0/lib/dm-types/json.rb
module DataMapper
module Types
class Json < DataMapper::Types::Text
#primitive String
#length 65535
#lazy true
...</code>
Attempted patch resulted in:
+type+ was DataMapper::Types::Json, which is not a supported type /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/property.rb:815:in
initialize' /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/model/property.rb:55:innew' /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.10.0/lib/dm-core/model/property.rb:55:inproperty'</code> </pre>
Comments and changes to this ticket
-
ojak June 29th, 2009 @ 03:04 AM
- Assigned user set to Dan Kubb (dkubb)
-
-
Dan Kubb (dkubb) July 1st, 2009 @ 05:09 PM
- State changed from new to accepted
- Milestone changed from 0.10.0 to 0.10.1
-
Dan Kubb (dkubb) October 4th, 2009 @ 09:33 PM
- Milestone changed from 0.10.1 to 0.10.2
[project:id#20609 not-tagged:"0.10.0" not-tagged:"0.10.1" milestone:id#51895 bulk edit command]
-
Dan Kubb (dkubb) October 6th, 2009 @ 12:38 PM
- State changed from accepted to resolved
This is now resolved in dm-core/master.
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »