{"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/knex/issues/1218","repository_url":"https://api.github.com/repos/tgriesser/knex","labels_url":"https://api.github.com/repos/tgriesser/knex/issues/1218/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/1218/comments","events_url":"https://api.github.com/repos/tgriesser/knex/issues/1218/events","html_url":"https://github.com/tgriesser/knex/issues/1218","id":135477439,"node_id":"MDU6SXNzdWUxMzU0Nzc0Mzk=","number":1218,"title":"How to change nullable constraint in column inside a migration?","user":{"login":"Rush","id":115926,"node_id":"MDQ6VXNlcjExNTkyNg==","avatar_url":"https://avatars2.githubusercontent.com/u/115926?v=4","gravatar_id":"","url":"https://api.github.com/users/Rush","html_url":"https://github.com/Rush","followers_url":"https://api.github.com/users/Rush/followers","following_url":"https://api.github.com/users/Rush/following{/other_user}","gists_url":"https://api.github.com/users/Rush/gists{/gist_id}","starred_url":"https://api.github.com/users/Rush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rush/subscriptions","organizations_url":"https://api.github.com/users/Rush/orgs","repos_url":"https://api.github.com/users/Rush/repos","events_url":"https://api.github.com/users/Rush/events{/privacy}","received_events_url":"https://api.github.com/users/Rush/received_events","type":"User","site_admin":false},"labels":[{"id":232918327,"node_id":"MDU6TGFiZWwyMzI5MTgzMjc=","url":"https://api.github.com/repos/tgriesser/knex/labels/PR%20please","name":"PR please","color":"bfe5bf","default":false},{"id":23356640,"node_id":"MDU6TGFiZWwyMzM1NjY0MA==","url":"https://api.github.com/repos/tgriesser/knex/labels/feature%20request","name":"feature request","color":"84b6eb","default":false},{"id":106997959,"node_id":"MDU6TGFiZWwxMDY5OTc5NTk=","url":"https://api.github.com/repos/tgriesser/knex/labels/schema","name":"schema","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-02-22T17:03:35Z","updated_at":"2018-09-10T18:01:06Z","closed_at":null,"author_association":"NONE","body":"I am trying to change a contraint on a column but this just appears to try to re-create the column and fails.\n\n``` js\nexports.up = function(knex, Promise) {  \n  return knex.schema.table(\"images\", function(table) {\n    table.string(\"checksum\").notNullable();\n  });\n};\n\nexports.down = function(knex, Promise) {\n  return knex.schema.table(\"images\", function(table) {\n    table.string(\"checksum\").nullable();\n  });\n};\n```\n"},"comment":{"url":"https://api.github.com/repos/tgriesser/knex/issues/comments/420004827","html_url":"https://github.com/tgriesser/knex/issues/1218#issuecomment-420004827","issue_url":"https://api.github.com/repos/tgriesser/knex/issues/1218","id":420004827,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDAwNDgyNw==","user":{"login":"aliyeysides-vg","id":40800806,"node_id":"MDQ6VXNlcjQwODAwODA2","avatar_url":"https://avatars0.githubusercontent.com/u/40800806?v=4","gravatar_id":"","url":"https://api.github.com/users/aliyeysides-vg","html_url":"https://github.com/aliyeysides-vg","followers_url":"https://api.github.com/users/aliyeysides-vg/followers","following_url":"https://api.github.com/users/aliyeysides-vg/following{/other_user}","gists_url":"https://api.github.com/users/aliyeysides-vg/gists{/gist_id}","starred_url":"https://api.github.com/users/aliyeysides-vg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliyeysides-vg/subscriptions","organizations_url":"https://api.github.com/users/aliyeysides-vg/orgs","repos_url":"https://api.github.com/users/aliyeysides-vg/repos","events_url":"https://api.github.com/users/aliyeysides-vg/events{/privacy}","received_events_url":"https://api.github.com/users/aliyeysides-vg/received_events","type":"User","site_admin":false},"created_at":"2018-09-10T18:01:06Z","updated_at":"2018-09-10T18:01:06Z","author_association":"NONE","body":"@et \r\n\r\nYour code worked for me but I also had to do `.notNullable().defaultTo(1).alter();` to avoid an error thrown when rolling back in scenarios where my tables already had null values."}}
{"actor":{"display_login":"aliyeysides-vg"}}