· 8 years ago · Mar 14, 2018, 10:00 PM
1 ~ (0.000018) SET sql_auto_is_null = 0
2 ~ (0.000011) SET SESSION sql_mode = 'ANSI,NO_BACKSLASH_ESCAPES,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION,NO_UNSIGNED_SUBTRACTION,TRADITIONAL'
3 ~ (0.012688) DROP TABLE IF EXISTS `users`
4 ~ (0.000747) DROP TABLE IF EXISTS `addresses`
5 ~ (0.000164) SHOW TABLES LIKE 'users'
6 ~ (0.000018) SHOW VARIABLES LIKE 'character_set_connection'
7 ~ (0.000019) SHOW VARIABLES LIKE 'collation_connection'
8 ~ (0.001213) CREATE TABLE `users` (`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(50), PRIMARY KEY(`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
9 ~ (0.000013) SHOW TABLES LIKE 'addresses'
10 ~ (0.001118) CREATE TABLE `addresses` (`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `country` VARCHAR(50), `user_id` INT(10) UNSIGNED NOT NULL, PRIMARY KEY(`id`)) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
11 ~ (0.002135) CREATE INDEX `index_addresses_user` ON `addresses` (`user_id`)
12 ~ (0.000124) INSERT INTO `users` (`name`) VALUES ('Bob')
13true
14 ~ (0.000019) SELECT `id`, `name` FROM `users` ORDER BY `id` LIMIT 1
15 ~ (0.000022) SELECT `id`, `country`, `user_id` FROM `addresses` WHERE `user_id` = 1 ORDER BY `id` LIMIT 1
16nil
17/usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/associations/one_to_many.rb:305:in `inverse_set': undefined method `readonly?' for nil:NilClass (NoMethodError)
18 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/associations/one_to_many.rb:293:in `resource_added'
19 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/collection.rb:1202:in `resources_added'
20 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/collection.rb:1202:in `map'
21 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/collection.rb:1202:in `resources_added'
22 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/collection.rb:649:in `set'
23 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/associations/one_to_many.rb:284:in `new_collection'
24 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/collection.rb:210:in `first'
25 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/associations/one_to_one.rb:20:in `get'
26 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/associations/relationship.rb:491:in `address'
27 from dmtest.rb:39