{"action":"created","issue":{"url":"https://api.github.com/repos/TryGhost/Ghost/issues/9587","repository_url":"https://api.github.com/repos/TryGhost/Ghost","labels_url":"https://api.github.com/repos/TryGhost/Ghost/issues/9587/labels{/name}","comments_url":"https://api.github.com/repos/TryGhost/Ghost/issues/9587/comments","events_url":"https://api.github.com/repos/TryGhost/Ghost/issues/9587/events","html_url":"https://github.com/TryGhost/Ghost/issues/9587","id":315518803,"number":9587,"title":"Importer fails with sqlite unable to insert default values","user":{"login":"docrinehart","id":5891405,"avatar_url":"https://avatars3.githubusercontent.com/u/5891405?v=4","gravatar_id":"","url":"https://api.github.com/users/docrinehart","html_url":"https://github.com/docrinehart","followers_url":"https://api.github.com/users/docrinehart/followers","following_url":"https://api.github.com/users/docrinehart/following{/other_user}","gists_url":"https://api.github.com/users/docrinehart/gists{/gist_id}","starred_url":"https://api.github.com/users/docrinehart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docrinehart/subscriptions","organizations_url":"https://api.github.com/users/docrinehart/orgs","repos_url":"https://api.github.com/users/docrinehart/repos","events_url":"https://api.github.com/users/docrinehart/events{/privacy}","received_events_url":"https://api.github.com/users/docrinehart/received_events","type":"User","site_admin":false},"labels":[{"id":632936878,"url":"https://api.github.com/repos/TryGhost/Ghost/labels/needs%20info","name":"needs info","color":"0e8a16","default":false},{"id":82875520,"url":"https://api.github.com/repos/TryGhost/Ghost/labels/server","name":"server","color":"0B939C","default":false}],"state":"open","locked":false,"assignee":{"login":"kirrg001","id":1160712,"avatar_url":"https://avatars0.githubusercontent.com/u/1160712?v=4","gravatar_id":"","url":"https://api.github.com/users/kirrg001","html_url":"https://github.com/kirrg001","followers_url":"https://api.github.com/users/kirrg001/followers","following_url":"https://api.github.com/users/kirrg001/following{/other_user}","gists_url":"https://api.github.com/users/kirrg001/gists{/gist_id}","starred_url":"https://api.github.com/users/kirrg001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirrg001/subscriptions","organizations_url":"https://api.github.com/users/kirrg001/orgs","repos_url":"https://api.github.com/users/kirrg001/repos","events_url":"https://api.github.com/users/kirrg001/events{/privacy}","received_events_url":"https://api.github.com/users/kirrg001/received_events","type":"User","site_admin":false},"assignees":[{"login":"kirrg001","id":1160712,"avatar_url":"https://avatars0.githubusercontent.com/u/1160712?v=4","gravatar_id":"","url":"https://api.github.com/users/kirrg001","html_url":"https://github.com/kirrg001","followers_url":"https://api.github.com/users/kirrg001/followers","following_url":"https://api.github.com/users/kirrg001/following{/other_user}","gists_url":"https://api.github.com/users/kirrg001/gists{/gist_id}","starred_url":"https://api.github.com/users/kirrg001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirrg001/subscriptions","organizations_url":"https://api.github.com/users/kirrg001/orgs","repos_url":"https://api.github.com/users/kirrg001/repos","events_url":"https://api.github.com/users/kirrg001/events{/privacy}","received_events_url":"https://api.github.com/users/kirrg001/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-04-18T15:00:30Z","updated_at":"2018-04-18T16:39:57Z","closed_at":null,"author_association":"NONE","body":"### Issue Summary\r\n\r\nTried importing a json from a GhostPro export, and got an error from the sqlite connector:\r\n\r\n> Import failed\r\n> `sqlite` does not support inserting default values. Specify values explicitly or use the `useNullAsDefault` config flag. (see docs http://knexjs.org/#Builder-insert).\r\n\r\nMacOS High Sierra (10.13.3)\r\nChrome 65.0.3325.181\r\nExport from GhostPro 1.22.1\r\nImport to local install Ghost 1.22.3\r\n\r\nNOTE: I have not yet tried downgrading local install to 1.22.1 and retrying import. (I haven't had enough time, but it's something I considered when gathering info for the bug report. I had assumed that GhostPro was running latest)\r\n\r\n### Steps to Reproduce\r\n\r\n1. Exported content from hosted ghost blog as json\r\n2. Install ghost locally\r\n3. Add user/blog, and try to import the json from step 1\r\n4. Import fails\r\n\r\nAside from trying to find the sqlite connector call and changing the code locally, I don't know if there's a way to set `useNullAsDefault` somewhere to try and re-import. Additionally, I think the error might be able to get caught and reworded for a friendlier user experience.\r\n\r\n### Technical details:\r\n\r\n* Ghost CLI Ver: 1.7.1\r\n* Ghost Version: 1.22.3\r\n* Node Version: 8.11.1\r\n* Browser/OS: Chrome 65.0.3325.181\r\n* Database: sqlite (bundled with ghost cli)"},"comment":{"url":"https://api.github.com/repos/TryGhost/Ghost/issues/comments/382451085","html_url":"https://github.com/TryGhost/Ghost/issues/9587#issuecomment-382451085","issue_url":"https://api.github.com/repos/TryGhost/Ghost/issues/9587","id":382451085,"user":{"login":"docrinehart","id":5891405,"avatar_url":"https://avatars3.githubusercontent.com/u/5891405?v=4","gravatar_id":"","url":"https://api.github.com/users/docrinehart","html_url":"https://github.com/docrinehart","followers_url":"https://api.github.com/users/docrinehart/followers","following_url":"https://api.github.com/users/docrinehart/following{/other_user}","gists_url":"https://api.github.com/users/docrinehart/gists{/gist_id}","starred_url":"https://api.github.com/users/docrinehart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docrinehart/subscriptions","organizations_url":"https://api.github.com/users/docrinehart/orgs","repos_url":"https://api.github.com/users/docrinehart/repos","events_url":"https://api.github.com/users/docrinehart/events{/privacy}","received_events_url":"https://api.github.com/users/docrinehart/received_events","type":"User","site_admin":false},"created_at":"2018-04-18T16:39:57Z","updated_at":"2018-04-18T16:39:57Z","author_association":"NONE","body":"I think the message more specifically refers to a database field that isn't getting a default value. Whil emost of the json fields have explicitly set `null` where appropriate, the connector doesn't know what to put into fields that aren't explicitly defined in the exported json.\r\n\r\nSetting a value for the setting the message suggests `(useNullAsDefault)` on the connector call, would enable me to run locally anyway, despite some fields not being present. If I knew what fields were missing, I could manually add them to the json myself, but without digging into the code, I'm not even sure what I would need to add, or what defaulting them to null might have as consequences."}}
{"actor":{"display_login":"docrinehart"}}