vidigami / backbone-sql

PostgreSQL, MySQL, and SQLite3 storage for BackboneORM
http://vidigami.github.io/backbone-orm/backbone-sql.html
MIT License
14 stars 8 forks source link

Fix test errors due to missing fields #9

Closed kmalakoff closed 10 years ago

kmalakoff commented 10 years ago

1) Model.cursor (cache: false, query_cache: false) "before each" hook: Error: ER_BAD_FIELD_ERROR: Unknown column 'foo' in 'field list', sql: insert into flats (boolean, created_at, json_data, name, updated_at) values (?, ?, ?, ?, ?), bindings: true,Wed May 21 2014 06:32:41 GMT-0700 (PDT),[object Object],flat_683,Wed May 21 2014 06:32:41 GMT-0700 (PDT)

9) self model relations (cache: false, query_cache: false, embed: false) "before each" hook: Error: ER_BAD_FIELD_ERROR: Unknown column 'is_base' in 'field list', sql: insert into self_references (created_at, is_base, name, owner_id) values (?, ?, ?, ?), bindings: Wed May 21 2014 06:32:54 GMT-0700 (PDT),true,self_reference_3113,

10) Model.cursor (cache: false, query_cache: false) "before each" hook: Error: column "json_data" of relation "flats" does not exist, sql: insert into "flats" ("boolean", "created_at", "json_data", "name", "updated_at") values (?, ?, ?, ?, ?) returning "id", bindings: true,2014-05-21T06:34:15.428-07:00,{"foo":{"bar":"baz"},"fizz":"buzz"},flat_14296,2014-05-21T06:34:15.428-07:00

forivall commented 10 years ago

Fix in b484204

The self model relations test now causes the following unrelated error:

Uncaught AssertionError: No errors: Error: Query failed for model: SelfReference with error: Error: table name "self_references" specified more than once, sql: select "self_references"."created_at" as "self_references_created_at", "self_references"."updated_at" as "self_references_updated_at", "self_references"."name" as "self_references_name", "self_references"."json_data" as "self_references_json_data", "self_references"."is_base" as "self_references_is_base", "self_references"."owner_id" as "self_references_owner_id", "self_references"."id" as "self_references_id", "self_references"."created_at" as "self_references_created_at", "self_references"."updated_at" as "self_references_updated_at", "self_references"."name" as "self_references_name", "self_references"."json_data" as "self_references_json_data", "self_references"."is_base" as "self_references_is_base", "self_references"."owner_id" as "self_references_owner_id", "self_references"."id" as "self_references_id" from "self_references" left outer join "self_references" on "self_references"."id" = "self_references"."owner_id" where "self_references"."is_base" = ?, bindings: true
at /Users/jord/Dev/backbone-sql/node_modules/backbone-orm/test/generators/relational/self.coffee:96:16
at /Users/jord/Dev/backbone-sql/node_modules/backbone-orm/lib/cursor.js:171:18
at /Users/jord/Dev/backbone-sql/node_modules/backbone-orm/lib/cursor.js:223:20
at /Users/jord/Dev/backbone-sql/lib/cursor.js:324:20
at tryCatch1 (/Users/jord/Dev/backbone-sql/node_modules/bluebird/js/main/util.js:63:19)
at Function.Promise$_errorAdapter (/Users/jord/Dev/backbone-sql/node_modules/bluebird/js/main/nodeify.js:46:15)
at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (/Users/jord/Dev/backbone-sql/node_modules/bluebird/js/main/promise.js:706:17)
at Promise$_settlePromiseAt [as _settlePromiseAt] (/Users/jord/Dev/backbone-sql/node_modules/bluebird/js/main/promise.js:868:14)
at Promise$_settlePromises [as _settlePromises] (/Users/jord/Dev/backbone-sql/node_modules/bluebird/js/main/promise.js:1006:14)
at Promise$_rejectPromises [as _rejectPromises] (/Users/jord/Dev/backbone-sql/node_modules/bluebird/js/main/promise.js:999:10)
at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (/Users/jord/Dev/backbone-sql/node_modules/bluebird/js/main/async.js:74:12)
at Async$consumeFunctionBuffer (/Users/jord/Dev/backbone-sql/node_modules/bluebird/js/main/async.js:37:14)
at process._tickCallback (node.js:415:13)