{"action":"closed","issue":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/issues/218","repository_url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/issues/218/comments","events_url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/issues/218/events","html_url":"https://github.com/miguelgrinberg/Flask-Migrate/issues/218","id":346997492,"node_id":"MDU6SXNzdWUzNDY5OTc0OTI=","number":218,"title":"Picking up changes to field(s) when running flask migrate command on MySQL","user":{"login":"melv1n","id":448898,"node_id":"MDQ6VXNlcjQ0ODg5OA==","avatar_url":"https://avatars2.githubusercontent.com/u/448898?v=4","gravatar_id":"","url":"https://api.github.com/users/melv1n","html_url":"https://github.com/melv1n","followers_url":"https://api.github.com/users/melv1n/followers","following_url":"https://api.github.com/users/melv1n/following{/other_user}","gists_url":"https://api.github.com/users/melv1n/gists{/gist_id}","starred_url":"https://api.github.com/users/melv1n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melv1n/subscriptions","organizations_url":"https://api.github.com/users/melv1n/orgs","repos_url":"https://api.github.com/users/melv1n/repos","events_url":"https://api.github.com/users/melv1n/events{/privacy}","received_events_url":"https://api.github.com/users/melv1n/received_events","type":"User","site_admin":false},"labels":[{"id":55528358,"node_id":"MDU6TGFiZWw1NTUyODM1OA==","url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-02T12:50:16Z","updated_at":"2018-08-03T10:39:54Z","closed_at":"2018-08-03T10:39:54Z","author_association":"NONE","body":"I was trying to modify an relationship table where I forgot to set the primary keys. I discovered that after saving my model the flask migrate command doesn't pickup changes to the field.\r\n\r\n**Example**\r\n\r\nI first had this and executed the migrate/upgrade: \r\n```\r\nuser_has_task = db.Table('user_has_task', db.Model.metadata,\r\n    db.Column('user_id', db.Integer, db.ForeignKey('user.id')),\r\n    db.Column('task_id', db.Integer, db.ForeignKey('task.id')),\r\n)\r\n```\r\n\r\nForgot to add the primary keys, so I added them:\r\n\r\n```\r\nuser_has_task = db.Table('user_has_task', db.Model.metadata,\r\n    db.Column('user_id', db.Integer, db.ForeignKey('user.id'), primary_key=True),\r\n    db.Column('task_id', db.Integer, db.ForeignKey('task.id'), primary_key=True),\r\n)\r\n```\r\nThe flask migrate command didn't pickup any changes when those keys were added.\r\nIs there any way that it can detect changes to any fields within the column when hitting the flask migrate command? I've searched and didn't find a specific answer whether this is by design or something that should work.\r\n\r\nMySQL version: 5.7.12"}}
{"actor":{"display_login":"melv1n"}}