-
-
Save jpr5/10314837e3c9da1dcb85 to your computer and use it in GitHub Desktop.
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
~ (0.000069) SET sql_auto_is_null = 0 | |
~ (0.000059) SET SESSION sql_mode = 'ANSI,NO_BACKSLASH_ESCAPES,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION,NO_UNSIGNED_SUBTRACTION,TRADITIONAL' | |
~ (0.001919) DROP TABLE IF EXISTS `foos` | |
~ (0.000268) SHOW TABLES LIKE 'foos' | |
~ (0.000135) SHOW VARIABLES LIKE 'character_set_connection' | |
~ (0.000105) SHOW VARIABLES LIKE 'collation_connection' | |
~ (0.001251) CREATE TABLE `foos` (`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `foo` TEXT, PRIMARY KEY(`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci | |
~ BLOB/TEXT column 'foo' used in key specification without a key length (code: 1170, sql state: 42000, query: CREATE INDEX `index_foos_foo` ON `foos` (`foo`), uri: mysql://root@localhost/foo) | |
.../dm-core.git/lib/dm-core/migrations.rb:151:in `execute_non_query': BLOB/TEXT column 'foo' used in key specification without a key length (DataObjects::SyntaxError) | |
from .../dm-core.git/lib/dm-core/migrations.rb:151:in `create_model_storage' | |
from .../dm-core.git/lib/dm-core/migrations.rb:149:in `each' | |
from .../dm-core.git/lib/dm-core/migrations.rb:149:in `create_model_storage' | |
from .../dm-core.git/lib/dm-core/adapters/data_objects_adapter.rb:287:in `with_connection' | |
from .../dm-core.git/lib/dm-core/migrations.rb:144:in `create_model_storage' | |
from .../dm-core.git/lib/dm-core/migrations.rb:1340:in `create_model_storage' | |
from .../dm-core.git/lib/dm-core/migrations.rb:1434:in `auto_migrate_up!' | |
from .../dm-core.git/lib/dm-core/migrations.rb:49:in `send' | |
from .../dm-core.git/lib/dm-core/migrations.rb:49:in `repository_execute' | |
from .../dm-core.git/lib/dm-core/model/descendant_set.rb:33:in `each' | |
from .../dm-core.git/lib/dm-core/model/descendant_set.rb:33:in `each' | |
from .../dm-core.git/lib/dm-core/migrations.rb:48:in `repository_execute' | |
from .../dm-core.git/lib/dm-core/migrations.rb:42:in `auto_migrate_up!' | |
from .../dm-core.git/lib/dm-core/migrations.rb:22:in `auto_migrate!' |
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
require 'rubygems' | |
require 'dm-core' | |
DataMapper::Logger.new(STDOUT, :debug) | |
DataMapper.setup(:default, "mysql://root@localhost/foo") | |
class Foo | |
include DataMapper::Resource | |
property :id, Serial | |
property :foo, Text, :index => true | |
end | |
::DataMapper.auto_migrate! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment