{"action":"created","issue":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/issues/178","repository_url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/issues/178/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/issues/178/comments","events_url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/issues/178/events","html_url":"https://github.com/miguelgrinberg/Flask-Migrate/issues/178","id":284524332,"number":178,"title":"how to migrate a database that is existed?","user":{"login":"Caratpine","id":11403002,"avatar_url":"https://avatars2.githubusercontent.com/u/11403002?v=4","gravatar_id":"","url":"https://api.github.com/users/Caratpine","html_url":"https://github.com/Caratpine","followers_url":"https://api.github.com/users/Caratpine/followers","following_url":"https://api.github.com/users/Caratpine/following{/other_user}","gists_url":"https://api.github.com/users/Caratpine/gists{/gist_id}","starred_url":"https://api.github.com/users/Caratpine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Caratpine/subscriptions","organizations_url":"https://api.github.com/users/Caratpine/orgs","repos_url":"https://api.github.com/users/Caratpine/repos","events_url":"https://api.github.com/users/Caratpine/events{/privacy}","received_events_url":"https://api.github.com/users/Caratpine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-12-26T09:25:08Z","updated_at":"2017-12-27T18:39:56Z","closed_at":null,"author_association":"NONE","body":"hi, miguelgrinberg\r\nI'm sorry to ask questions again. I use `Flask-Migrate` to migrate my database that is existed. \r\n\r\nhere are my operations:\r\n\r\n```Python\r\npython manage.py db init\r\npython manage.py db migrate\r\n```\r\n\r\nwhen I execute `python manage.py db migrate`, logs show:\r\n\r\n```\r\nINFO  [alembic.runtime.migration] Context impl MySQLImpl.\r\nINFO  [alembic.runtime.migration] Will assume non-transactional DDL.\r\nINFO  [alembic.autogenerate.compare] Detected added table 'a'\r\nINFO  [alembic.autogenerate.compare] Detected added table 'b'\r\nINFO  [alembic.autogenerate.compare] Detected added table 'c'\r\nINFO  [alembic.autogenerate.compare] Detected added table 'd'\r\nINFO  [alembic.autogenerate.compare] Detected added table 'e'\r\nINFO  [alembic.autogenerate.compare] Detected added table 'f'\r\nINFO  [alembic.autogenerate.compare] Detected added table 'g'\r\nINFO  [alembic.autogenerate.compare] Detected added table 'h'\r\n```\r\n\r\nBut these tables are existed.\r\nSo I continue executing:\r\n\r\n```Python\r\npython manage.py db upgrade\r\n```\r\n\r\nlogs show success. Actually, it doesn't create tables,  because there are existed tables in my database.\r\n\r\nBut when I modify my A Model, I add a column\r\n\r\nexecute:\r\n\r\n```Python\r\npython manage.py db migrate\r\n```\r\nlogs show:\r\n\r\n```\r\nINFO  [alembic.runtime.migration] Context impl MySQLImpl.\r\nINFO  [alembic.runtime.migration] Will assume non-transactional DDL.\r\nINFO  [alembic.autogenerate.compare] Detected added column 'a.is_show'\r\n```\r\nexecute:\r\n\r\n```\r\npython manage.py db upgrade\r\n```\r\nsuccessfully.\r\n\r\nBut my table A doesn't add `is_show` column successfully, i don't know how to solve it.\r\n\r\nAnother question, I want to migrate a database that is existed. Are there any cautions？\r\n\r\nThanks.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/issues/comments/354156859","html_url":"https://github.com/miguelgrinberg/Flask-Migrate/issues/178#issuecomment-354156859","issue_url":"https://api.github.com/repos/miguelgrinberg/Flask-Migrate/issues/178","id":354156859,"user":{"login":"miguelgrinberg","id":2715854,"avatar_url":"https://avatars0.githubusercontent.com/u/2715854?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelgrinberg","html_url":"https://github.com/miguelgrinberg","followers_url":"https://api.github.com/users/miguelgrinberg/followers","following_url":"https://api.github.com/users/miguelgrinberg/following{/other_user}","gists_url":"https://api.github.com/users/miguelgrinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelgrinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelgrinberg/subscriptions","organizations_url":"https://api.github.com/users/miguelgrinberg/orgs","repos_url":"https://api.github.com/users/miguelgrinberg/repos","events_url":"https://api.github.com/users/miguelgrinberg/events{/privacy}","received_events_url":"https://api.github.com/users/miguelgrinberg/received_events","type":"User","site_admin":false},"created_at":"2017-12-27T18:39:56Z","updated_at":"2017-12-27T18:39:56Z","author_association":"OWNER","body":"Did you use the `--multidb` option with the `init` option to create a migration repository for multiple databases? See http://flask-migrate.readthedocs.io/en/latest/#multiple-database-support."}}
{"actor":{"display_login":"miguelgrinberg"}}