{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-mobile-apps-node/issues/396","repository_url":"https://api.github.com/repos/Azure/azure-mobile-apps-node","labels_url":"https://api.github.com/repos/Azure/azure-mobile-apps-node/issues/396/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-mobile-apps-node/issues/396/comments","events_url":"https://api.github.com/repos/Azure/azure-mobile-apps-node/issues/396/events","html_url":"https://github.com/Azure/azure-mobile-apps-node/issues/396","id":145205297,"number":396,"title":"DynamicSchema not working if a new field is not initialized","user":{"login":"m-andersen","id":17090294,"avatar_url":"https://avatars.githubusercontent.com/u/17090294?v=3","gravatar_id":"","url":"https://api.github.com/users/m-andersen","html_url":"https://github.com/m-andersen","followers_url":"https://api.github.com/users/m-andersen/followers","following_url":"https://api.github.com/users/m-andersen/following{/other_user}","gists_url":"https://api.github.com/users/m-andersen/gists{/gist_id}","starred_url":"https://api.github.com/users/m-andersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-andersen/subscriptions","organizations_url":"https://api.github.com/users/m-andersen/orgs","repos_url":"https://api.github.com/users/m-andersen/repos","events_url":"https://api.github.com/users/m-andersen/events{/privacy}","received_events_url":"https://api.github.com/users/m-andersen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-01T15:05:54Z","updated_at":"2016-04-01T17:08:36Z","closed_at":null,"body":"While inserting a new row in SQL table, I had a few fields which where not yet initialized. They are set to null. They are to be initialized later. When executing table.insert(item) the insert fails because alter table has not been done:\r\n\r\n`2016-04-01T15:00:12.486Z - debug: SQL statement failed - Invalid column name 'household_id'.: INSERT INTO [dbo].[MyfUserInfo] ([first_name],[last_name],[user_email],[household_id],[id],[user_id],[uniq_user_id]) VALUES (@first_name,@last_name,@user_email,@household_id,@id,@user_id,@uniq_user_id); SELECT * FROM [dbo].[MyfUserInfo] WHERE [id] = @id with parameters [{\"name\":\"first_name\",\"value\":\"Martin\",\"type\":{}},{\"name\":\"last_name\",\"value\":\"Andersen\",\"type\":{}},{\"name\":\"user_email\",\"value\":\"mega@test.com\",\"type\":{}},{\"name\":\"household_id\",\"value\":null},{\"name\":\"id\",\"value\":\"847da140-03d2-4e55-867b-f4f896b67592\",\"type\":{\"length\":255}},{\"name\":\"user_id\",\"value\":\"1234\",\"type\":{}},{\"name\":\"uniq_user_id\",\"value\":\"my_id_1234\",\"type\":{}}]`\r\n\r\nIf I set it to some value the insert + ALTER table completes without errors.\r\n"},"comment":{"url":"https://api.github.com/repos/Azure/azure-mobile-apps-node/issues/comments/204473797","html_url":"https://github.com/Azure/azure-mobile-apps-node/issues/396#issuecomment-204473797","issue_url":"https://api.github.com/repos/Azure/azure-mobile-apps-node/issues/396","id":204473797,"user":{"login":"danderson00","id":1265935,"avatar_url":"https://avatars.githubusercontent.com/u/1265935?v=3","gravatar_id":"","url":"https://api.github.com/users/danderson00","html_url":"https://github.com/danderson00","followers_url":"https://api.github.com/users/danderson00/followers","following_url":"https://api.github.com/users/danderson00/following{/other_user}","gists_url":"https://api.github.com/users/danderson00/gists{/gist_id}","starred_url":"https://api.github.com/users/danderson00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danderson00/subscriptions","organizations_url":"https://api.github.com/users/danderson00/orgs","repos_url":"https://api.github.com/users/danderson00/repos","events_url":"https://api.github.com/users/danderson00/events{/privacy}","received_events_url":"https://api.github.com/users/danderson00/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T17:08:36Z","updated_at":"2016-04-01T17:08:36Z","body":"Hi @m-andersen, I'm not 100% clear on what you mean here. The insert failure is always logged, even if the dynamic schema operation completes afterwards, it doesn't necessarily mean a terminal failure.\r\n\r\nAre you saying the alter table statement is not executed at all when some of the fields are null?"}}