{"action":"created","issue":{"url":"https://api.github.com/repos/ergo/ziggurat_foundations/issues/35","repository_url":"https://api.github.com/repos/ergo/ziggurat_foundations","labels_url":"https://api.github.com/repos/ergo/ziggurat_foundations/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/ergo/ziggurat_foundations/issues/35/comments","events_url":"https://api.github.com/repos/ergo/ziggurat_foundations/issues/35/events","html_url":"https://github.com/ergo/ziggurat_foundations/issues/35","id":149299023,"number":35,"title":"Error on alembic migrations from docs","user":{"login":"arianmaykon","id":40794,"avatar_url":"https://avatars.githubusercontent.com/u/40794?v=3","gravatar_id":"","url":"https://api.github.com/users/arianmaykon","html_url":"https://github.com/arianmaykon","followers_url":"https://api.github.com/users/arianmaykon/followers","following_url":"https://api.github.com/users/arianmaykon/following{/other_user}","gists_url":"https://api.github.com/users/arianmaykon/gists{/gist_id}","starred_url":"https://api.github.com/users/arianmaykon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arianmaykon/subscriptions","organizations_url":"https://api.github.com/users/arianmaykon/orgs","repos_url":"https://api.github.com/users/arianmaykon/repos","events_url":"https://api.github.com/users/arianmaykon/events{/privacy}","received_events_url":"https://api.github.com/users/arianmaykon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-18T23:16:43Z","updated_at":"2016-04-19T16:45:01Z","closed_at":null,"body":"Following \r\nhttps://ziggurat-foundations.readthedocs.org/en/latest/configuration.html#configure-ziggurat-with-pyramid-framework\r\non the [Wiki2 Pyramid Tutorial](http://docs.pylonsproject.org/projects/pyramid/en/latest/tutorials/wiki2/index.html)\r\ngives some errors on the initial migration step ($VENV/bin/alembic upgrade head).\r\n\r\nI'm using Python 3.5.1 and Pyramid 1.6.1, here's the output:\r\n\r\n```\r\n(.venv) ➜  tutorial $VENV/bin/alembic upgrade head\r\nINFO  [alembic.runtime.migration] Context impl MySQLImpl.\r\nINFO  [alembic.runtime.migration] Will assume non-transactional DDL.\r\nINFO  [alembic.runtime.migration] Running upgrade  -> 2bb1ba973f0b, initial table layout\r\nINFO  [alembic.runtime.migration] Running upgrade 2bb1ba973f0b -> 24ab8d11f014, add external identity tables\r\nINFO  [alembic.runtime.migration] Running upgrade 24ab8d11f014 -> 5c84d7260c5, add id/parent id to resource structure\r\nINFO  [alembic.runtime.migration] Running upgrade 5c84d7260c5 -> 46a9c4fb9560, make password hash field bigger\r\nINFO  [alembic.runtime.migration] Running upgrade 46a9c4fb9560 -> 264049f80948, create ordering column\r\nINFO  [alembic.runtime.migration] Running upgrade 264049f80948 -> 2d472fe79b95, bigger identity datatypes\r\nTraceback (most recent call last):\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py\", line 1139, in _execute_context\r\n    context)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/engine/default.py\", line 450, in do_execute\r\n    cursor.execute(statement, parameters)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/cursors.py\", line 226, in execute\r\n    self.errorhandler(self, exc, value)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/connections.py\", line 36, in defaulterrorhandler\r\n    raise errorvalue\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/cursors.py\", line 217, in execute\r\n    res = self._query(query)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/cursors.py\", line 378, in _query\r\n    rowcount = self._do_query(q)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/cursors.py\", line 341, in _do_query\r\n    db.query(q)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/connections.py\", line 280, in query\r\n    _mysql.connection.query(self, query)\r\n_mysql_exceptions.DataError: (1171, 'All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead')\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/bin/alembic\", line 9, in <module>\r\n    load_entry_point('alembic', 'console_scripts', 'alembic')()\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/config.py\", line 479, in main\r\n    CommandLine(prog=prog).main(argv=argv)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/config.py\", line 473, in main\r\n    self.run_cmd(cfg, options)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/config.py\", line 456, in run_cmd\r\n    **dict((k, getattr(options, k)) for k in kwarg)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/command.py\", line 174, in upgrade\r\n    script.run_env()\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/script/base.py\", line 397, in run_env\r\n    util.load_python_file(self.dir, 'env.py')\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/util/pyfiles.py\", line 93, in load_python_file\r\n    module = load_module_py(module_id, path)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/util/compat.py\", line 68, in load_module_py\r\n    module_id, path).load_module(module_id)\r\n  File \"<frozen importlib._bootstrap_external>\", line 385, in _check_name_wrapper\r\n  File \"<frozen importlib._bootstrap_external>\", line 806, in load_module\r\n  File \"<frozen importlib._bootstrap_external>\", line 665, in load_module\r\n  File \"<frozen importlib._bootstrap>\", line 268, in _load_module_shim\r\n  File \"<frozen importlib._bootstrap>\", line 693, in _load\r\n  File \"<frozen importlib._bootstrap>\", line 673, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap_external>\", line 662, in exec_module\r\n  File \"<frozen importlib._bootstrap>\", line 222, in _call_with_frames_removed\r\n  File \"/Users/maykon/.python-eggs/ziggurat_foundations-0.6.2-py3.5.egg-tmp/ziggurat_foundations/migrations/env.py\", line 85, in <module>\r\n    run_migrations_online()\r\n  File \"/Users/maykon/.python-eggs/ziggurat_foundations-0.6.2-py3.5.egg-tmp/ziggurat_foundations/migrations/env.py\", line 78, in run_migrations_online\r\n    context.run_migrations()\r\n  File \"<string>\", line 8, in run_migrations\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/runtime/environment.py\", line 797, in run_migrations\r\n    self.get_context().run_migrations(**kw)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/runtime/migration.py\", line 312, in run_migrations\r\n    step.migration_fn(**kw)\r\n  File \"/Users/maykon/.python-eggs/ziggurat_foundations-0.6.2-py3.5.egg-tmp/ziggurat_foundations/migrations/versions/2d472fe79b95_bigger_identity_data.py\", line 19, in upgrade\r\n    type_=sa.String(255), existing_type=sa.String(50))\r\n  File \"<string>\", line 8, in alter_column\r\n  File \"<string>\", line 3, in alter_column\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/operations/ops.py\", line 1414, in alter_column\r\n    return operations.invoke(alt)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/operations/base.py\", line 318, in invoke\r\n    return fn(self, operation)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/operations/toimpl.py\", line 53, in alter_column\r\n    **operation.kw\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/ddl/mysql.py\", line 67, in alter_column\r\n    else existing_autoincrement\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/alembic-0.8.6-py3.5.egg/alembic/ddl/impl.py\", line 118, in _exec\r\n    return conn.execute(construct, *multiparams, **params)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py\", line 914, in execute\r\n    return meth(self, multiparams, params)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/sql/ddl.py\", line 68, in _execute_on_connection\r\n    return connection._execute_ddl(self, multiparams, params)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py\", line 968, in _execute_ddl\r\n    compiled\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py\", line 1146, in _execute_context\r\n    context)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py\", line 1341, in _handle_dbapi_exception\r\n    exc_info\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/util/compat.py\", line 200, in raise_from_cause\r\n    reraise(type(exception), exception, tb=exc_tb, cause=cause)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/util/compat.py\", line 183, in reraise\r\n    raise value.with_traceback(tb)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/engine/base.py\", line 1139, in _execute_context\r\n    context)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/sqlalchemy/engine/default.py\", line 450, in do_execute\r\n    cursor.execute(statement, parameters)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/cursors.py\", line 226, in execute\r\n    self.errorhandler(self, exc, value)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/connections.py\", line 36, in defaulterrorhandler\r\n    raise errorvalue\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/cursors.py\", line 217, in execute\r\n    res = self._query(query)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/cursors.py\", line 378, in _query\r\n    rowcount = self._do_query(q)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/cursors.py\", line 341, in _do_query\r\n    db.query(q)\r\n  File \"/Users/maykon/Projects/pyramid_tutorial/.venv/lib/python3.5/site-packages/mysqlclient-1.3.7-py3.5-macosx-10.11-x86_64.egg/MySQLdb/connections.py\", line 280, in query\r\n    _mysql.connection.query(self, query)\r\nsqlalchemy.exc.DataError: (_mysql_exceptions.DataError) (1171, 'All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead') [SQL: 'ALTER TABLE external_identities MODIFY external_id VARCHAR(255) NULL']\r\n```"},"comment":{"url":"https://api.github.com/repos/ergo/ziggurat_foundations/issues/comments/212011124","html_url":"https://github.com/ergo/ziggurat_foundations/issues/35#issuecomment-212011124","issue_url":"https://api.github.com/repos/ergo/ziggurat_foundations/issues/35","id":212011124,"user":{"login":"ergo","id":33021,"avatar_url":"https://avatars.githubusercontent.com/u/33021?v=3","gravatar_id":"","url":"https://api.github.com/users/ergo","html_url":"https://github.com/ergo","followers_url":"https://api.github.com/users/ergo/followers","following_url":"https://api.github.com/users/ergo/following{/other_user}","gists_url":"https://api.github.com/users/ergo/gists{/gist_id}","starred_url":"https://api.github.com/users/ergo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ergo/subscriptions","organizations_url":"https://api.github.com/users/ergo/orgs","repos_url":"https://api.github.com/users/ergo/repos","events_url":"https://api.github.com/users/ergo/events{/privacy}","received_events_url":"https://api.github.com/users/ergo/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T16:45:01Z","updated_at":"2016-04-19T16:45:01Z","body":"I tried running the testsuite on Mysql 5.6.28 and all tests passed - including migrations."}}