{"action":"opened","issue":{"url":"https://api.github.com/repos/nvdnkpr/loopback-connector-arangodb/issues/28","repository_url":"https://api.github.com/repos/nvdnkpr/loopback-connector-arangodb","labels_url":"https://api.github.com/repos/nvdnkpr/loopback-connector-arangodb/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/nvdnkpr/loopback-connector-arangodb/issues/28/comments","events_url":"https://api.github.com/repos/nvdnkpr/loopback-connector-arangodb/issues/28/events","html_url":"https://github.com/nvdnkpr/loopback-connector-arangodb/issues/28","id":141740246,"number":28,"title":"automigrate fails if the table doesn't exist","user":{"login":"doginthehat","id":843366,"avatar_url":"https://avatars.githubusercontent.com/u/843366?v=3","gravatar_id":"","url":"https://api.github.com/users/doginthehat","html_url":"https://github.com/doginthehat","followers_url":"https://api.github.com/users/doginthehat/followers","following_url":"https://api.github.com/users/doginthehat/following{/other_user}","gists_url":"https://api.github.com/users/doginthehat/gists{/gist_id}","starred_url":"https://api.github.com/users/doginthehat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doginthehat/subscriptions","organizations_url":"https://api.github.com/users/doginthehat/orgs","repos_url":"https://api.github.com/users/doginthehat/repos","events_url":"https://api.github.com/users/doginthehat/events{/privacy}","received_events_url":"https://api.github.com/users/doginthehat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-18T00:10:28Z","updated_at":"2016-03-18T00:10:28Z","closed_at":null,"body":"I'm just trying out the connector and noticed an error when trying to run automigrate.\r\n\r\nI've got a new collection that hasn't been created in the arango database. The automigrate script throws an error saying the collection doesn't exist (which defeats the purpose a bit).\r\n\r\nI've narrowed it down to the callback to `collection.drop` \r\n\r\n          return collection.drop(function(err) {\r\n            if (err) {\r\n              if (err.response.body != null) {\r\n                err = err.response.body;\r\n                if (!(err.error === true && err.errorNum === 1203 && err.errorMessage === 'unknown collection \\'' + model + '\\'')) {\r\n                    return modelCallback(err);\r\n                }\r\n              }\r\n            }\r\n            debug('create collection %s for model %s', collectionName, model);\r\n            return collection.create(modelCallback);\r\n          });\r\n\r\nI'm not sure if there's a reason behind having this but taking out the `if (err)` section fixes the first migration problem."}}